Irish legislators have passed a bill to make cannabis legal for medicinal use after the government said it would not stand in the way.

The bill seeks to legalise and regulate cannabis products for those suffering serious illnesses like cancer, multiple sclerosis and fibromyalgia, as well as people who live with chronic pain.

Its sponsor, People Before Profit TD Gino Kenny, said that if finalised it would give doctors the power to decide if their patients would benefit from the drug, RTÉ reported. The bill was passed in Ireland's lower house without a vote.

It is the latest in a series of moves by politicians around the world to make marijuana legal for medical use. A school district in New Jersey, USA, has even allowed the drug to be administered to pupils on its grounds by a parent or guardian.

In the UK an underground medical marijuana industry has sprung up, according to a Viceland documentary. Growers give away tens of thousands of pounds-worth of the drug to people who are ill, and risk spending years in prison.

Cannabis is a Class B drug in the UK. Possession is punishable by five years in prison, while those caught supplying it can receive a 14-year sentence.

Ireland's legalisation bill will now pass to the Dáil's committee stage where health minister Simon Harris said regulators will advise him on the scientific and clinical value of cannabis as a medicine.