The U.S. House of Representatives passed a bill Wednesday that would grant legal marijuana businesses access to banking, a measure that would clear up a longstanding headache for the industry.

The bill, called the SAFE Banking Act, passed 321-103 on the strength of near-unanimous support from Democrats and nearly half of Republicans. Its prospects in the Senate are uncertain, but supporters said the amount of Republican support in the House was a good omen.

“This is a sign the time has come for comprehensive cannabis reform,” said Morgan Fox, a spokesman for the National Cannabis Industry Association. “The fact that we got almost half the Republicans is a huge sign we’re moving in the right direction toward sensible policies.”

Colorado Reps. Diana DeGette, Joe Neguse, Jason Crow and Ed Perlmutter, all Democrats, and Republican Scott Tipton voted in favor of the bill. Reps. Ken Buck and Doug Lamborn, both Republicans, voted no.

“This is a huge milestone in reforming federal cannabis laws and reducing the public safety risk in communities across the country,” Perlmutter, who sponsored the bill, said in a tweet Wednesday.

Thirty-three states have legalized cannabis for medical or recreational use, but the federal prohibition on the drug has made it difficult for businesses in the multibillion-dollar industry to get bank accounts, loans and other financial services.

The bill would allow businesses legitimately operating under state laws to access loans, lines of credit and other banking services, while sheltering financial institutions from prosecution for handling marijuana-linked money.

More financial institutions began banking with the industry as legalization spread and as the Obama administration instituted policies that allowed them to do so, with some important caveats, but the Trump administration rescinded those guidelines under former Attorney General Jeff Sessions.

Many pot businesses have had to conduct sales and pay vendors or taxes in cash, making them potential robbery targets.

Washington Rep. Denny Heck, a supporter of the bill, characterized it as a public safety measure. In urging lawmakers to vote yes, Heck relayed the story of a 24-year-old Marine veteran, Travis Mason, who was shot and killed during a robbery of a dispensary in suburban Denver in 2016.

“Because the federal law did not allow for that business to be banked, to be within the guardrails of the financial system, an evil person walked in that night and shot Travis dead,” Heck said. “That does not have to happen. It is not hypothetical.”

Rob Nichols, president of the American Bankers Association, called the vote “a significant step forward for public safety, transparency and common sense.”

“By helping to provide clarity for the financial sector in those states where cannabis is legal, this bill will help banks meet the needs of their communities while reducing cash-motivated crimes, increasing the efficiency of tax collections and improving the cannabis industry’s financial accountability,” he said.

Opponents said it would facilitate the spread of marijuana. In a written statement, Kevin Sabet of the anti-legalization group Smart Approaches to Marijuana, noted that hundreds of people have been sickened and several have died after using marijuana vaping products.

“Surely this is not the time to reward Big Marijuana with investment opportunities,” Sabet said. “Granting this industry access to banks will bring billions of dollars of institutional investment from the titans of addiction and vastly expand the harms we are already witnessing.”

Justin Wingerter contributed to this report.