Two landmark pieces of legislation passed Connecticut’s Senate on Saturday, sending the legalization of medical marijuana and a package to reform the state’s voting system to the desk of Gov. Dannel Malloy.

After 10 hours of debate, the Senate passed by a 21-13 margin a bill allowing patients with certain chronic illnesses to obtain small amounts of marijuana. Later, the Senate also voted 19-16 for a voting reform package that provides for voter registration online and on Election Day.

Malloy has pledged to sign both of the bills once they reach his desk. While he acknowledged that legalizing medical marijuana has posed problems for states in the past, he stressed in a statement following the bill’s passage that provisions built into Connecticut’s legislation will protect the state from the federal government.

“This legislation is about accomplishing one objective: providing relief to those with severe medical illnesses,” Malloy said in the statement. “Under this proposal, the Department of Consumer Protection will be able to carefully regulate and monitor the medicinal use of this drug in order to avoid the problems encountered in some other states.”

The bill, written by the Judiciary Committee, is more restrictive than similar legislation in other states, requiring a doctor to recommend marijuana to a patient and a pharmacist to sell it. While opponents read a letter from U.S. Attorney David Fein that called the bill a violation of federal law, and argued that the bill’s passage would lead to crimes like the 2007 Cheshire home invasion, none of the 48 amendments filed against the bill were passed.

Both Malloy and Lt. Gov. Nancy Wyman — who introduced the elections reform bill on Martin Luther King Jr. Day this year — hailed its passage as a victory for voter access.

“These reforms allow more people to have their voices to be heard in a places where it truly matters — the voting,” Wyman said in a statement. “More of our residents will have the power to decide who they want to represent them in government, how they want their tax dollars spent, what kind of health care system they want and how they want their children to be educated.”

Supports of the bill have pointed to evidence that these measures, particularly Election Day voter registration, have boosted turnout in other states. The top four states for voter turnout in the last two presidential elections offer Election Day voter registration.

Opponents argue that looser voter registration rules will make it easier to commit voter fraud and create chaos at the ballot box. But supporters pointed out that registration requirements are no different than they are for earlier registration, and all names will be checked against a statewide voter database.

The General Assembly adjourns for the year on May 9.