Doctors will be allowed to order medicinal cannabis for their terminally ill patients from overseas when local supply falls short, after the majority of the Senate backed a Greens bill to relax import rules.

The bill was previously defeated in a tie, but passed 40 votes to 30 on Tuesday afternoon after One Nation and other crossbenchers sided with the Greens and Labor.

Health Minister Greg Hunt warned the new rules could open the floodgates to "unregulated quantities" of cannabis coming into Australia that could be diverted by criminals, and warned lives would be put at risk.

"Removing the safeguards could potentially allow in dangerous drugs that could take lives," Mr Hunt told reporters in Canberra, referring to other cannabis derivatives like hashish.

But Greens leader Richard Di Natale said the rules would only allow cannabis to be imported from regulated markets overseas.

"It's utter nonsense," he said.

"If we accept that medicinal cannabis is a treatment that's effective for people that are suffering, and the evidence is very clear that that's exactly what it does, then why would we say that you can get access to other medicines from overseas that aren't available here in Australia but not medicinal cannabis?"

Medicinal cannabis passes 40-30:

FOR- Greens, Labor, One Nation, Lambie, Leyonhjelm, Hinch, Gichuhi.

AGAINST- Lib, Nat, NXT, Bernardi. pic.twitter.com/PX7cpLeljc — Alice Workman (@workmanalice) June 13, 2017

The reform will put medicinal cannabis on the Therapeutic Goods Administration's Category A list, which makes it easier for doctors to expedite the importation of drugs and get them into the hands of terminally ill patients.

It currently sits on the Category B list, where approval for access can take months.

The health minister defended the current system, saying the government's rules had already seen four shipments of medicinal cannabis arrive in Australia.

He attacked the crossbenchers who sided with the opposition for a "reckless and irresponsible decision".

"Medicinal cannabis, where the doctors believe it can be prescribed in a safe form, is available," Mr Hunt said.

But Mr Di Natale said the current level of access was not acceptable, given some patients were still taking the risk of purchasing cannabis illegally.

WATCH: How Victoria legalised medicinal cannabis from SBS's Viceland.