Image copyright Reuters Image caption Nearly half of US states have legalised medical marijuana use

The US House of Representatives has passed legislation blocking the Department of Justice from interfering with state laws permitting medical marijuana use.

Republicans and Democrats banded together in the 219-189 vote in a surprising show of bipartisan support.

The provision does not address the use of marijuana for recreational purposes.

Nearly half the 50 US states have legalised medical marijuana, including for use by cancer patients.

But in recent years, federal agents are said to have raided dispensaries in states where marijuana is legal, seizing drugs and cash.

"Federal tax dollars will no longer be wasted arresting seriously ill medical marijuana patients and those who provide to them," Dan Riffle, director of federal policies for the Marijuana Policy Project, wrote in a statement. He called the House vote on Friday "historic".

"It's yet another sign that our federal government is shifting toward a more sensible marijuana policy," he added

Bill sponsor Congressman Dana Rohrabacher told US media that public opinion of medical marijuana was also changing.

US President Barack Obama recently described marijuana as no more dangerous than alcohol, and instructed the justice department to halt prosecutions of banks that do business with cannabis firms.

Opponents argue the drug is not regulated enough by the states and negatively impacts users' health, while the American Medical Association has labelled it "dangerous".

The bill next goes to the Democratic-led US Senate for approval.