The Judiciary Committee voted 34 to 10 Tuesday in favor of legislation that would allow residents to use medicinal marijuana.

The bill prohibits the use and prosecution of patients who have registered to use the drug for their medical condition.

There’s was discussion over whether the state would be in violation of federal law and whether it should allow patients to grow their own or ask the University of Connecticut agricultural stations to grow it for the patients.

Former Gov. M. Jodi Rell vetoed similar legislation in 2007 after it passed both chambers of the legislature. This year Gov. Dannel P. Malloy made it one of his legislative priorities and has said he will sign legislation if it reaches his desk.

The bill now heads to the Senate.