New Zealand made marijuana legal for terminally ill patients with a new law passed on Tuesday.

The Health Minister David Clark says it will give 25,000 people relief from pain in their final days.

The government has promised a referendum on full legalization by 2020, and one study suggests 2/3 people are in favour of some kind of legalization.

Many signs point to New Zealand joining Canada and Uruguay, the two countries which have fully legalized the drug already.

New Zealand passed a law on Tuesday which will relax marijuana laws, and allow terminally ill patients to use the drug. The government has promised to follow the move with a full referendum on making recreational weed legal.

The new law, the Misuse of Drugs (Medicinal Cannabis) Amendment Bill, means that some 25,000 terminally ill or ill patients can use marijuana products to alleviate pain without fear of arrest, Health Minister David Clark said.

The law also means that marijuana products can be manufactured in New Zealand for both domestic and overseas markets, the Associated Press (AP) reported.

A permit for medical marijuana in California, US. Wikimedia Commons

The new law increases New Zealand's chances of being the third country in the world to legalize recreational marijuana, after Canada and Uruguay, as Prime Minister Jacinda Ardern has promised a non-binding referendum on the issue before 2020.

Read more: How smoking cannabis can affect your sleep for better or worse

If the vote goes ahead, polls suggest it could result in legalization. Support is growing, with two thirds of people reportedly pro-full, or pro-partial decriminalization, according to the New Zealand Drug Foundation.

The government's centre-right opposition, the New Zealand National Party, oppose the new law. Dr. Shane Reti, a health spokesman for the party, called it "lazy and dangerous" because people will start smoking up in public, AP said.

The new bill, which passed the third reading on Tuesday, will become law after receiving assent from the Governor-General, the final, ceremonial part of the legislative process.