For the first time in U.S. history, Congress approved a measure that would prohibit the federal government from interfering with states medical marijuana laws.

In a bipartisan vote late Thursday, the House of Representatives passed an amendment to H.R. 4660 offered by Rep. Dana Rohrabacher, R-Calif., to protect medical marijuana patients and providers. For Democrats, 170 voted in favor of the measure, and a record-high number of Republicans, 49, backed the legislation, Vox.com reported.

The measure, which was attached to a funding bill for several federal agencies, restricts the Department of Justice and Drug Enforcement Administration (DEA) from raiding state-legal medical marijuana dispensaries. However, in order to be implemented, the measure must first be approved by the Senate and signed into law by President Obama.

Advocates for marijuana legalization praised the House vote.

"Congress is officially pulling out of the war on medical marijuana patients and providers. Federal tax dollars will no longer be wasted arresting seriously ill medical marijuana patients and those who provide to them," said Dan Riffle, director of federal policies for the Marijuana Policy Project (MPP), in a statement. "This is a historic vote, and it's yet another sign that our federal government is shifting toward a more sensible marijuana policy."

While speaking on the House floor, Rep. Rohrabacher called the amendment "a no-brainer" for Republicans who support states' rights. He also argued against allowing the federal government to interfere with a doctor-patient relationship.

"Some people are suffering, and if a doctor feels that he needs to prescribe something to alleviate that suffering, it is immoral for this government to get in the way," Rohrabacher said, according to the Huffington Post. "And that's what's happening."

Opponents of the measure, like Republican Rep. Andy Harris, argued that there were no medical benefits to marijuana and that the amendment is just a step toward legalizing recreational pot.

"It's the camel's nose under the tent," Harris said. Citing an anti-marijuana report published by the DEA earlier this month, he stated that medical marijuana was just "a means to an end."