Warsaw (AFP) - Poland's lower house of parliament, which is controlled by the conservatives, on Thursday voted to make medicinal marijuana legal under certain circumstances.

The EU member follows in the steps of the Czech Republic, Finland, the Netherlands, Portugal, Spain, as well as 23 US states and Uruguay, which in 2013 became the first country to make cannabis entirely legal.

Four hundred and forty lawmakers voted in favour -- with two against and one abstention -- of legislation to allow prescription-only cannabis-based medicine to be made at pharmacies using imported ingredients.

The law, which still needs to be approved by the senate and the Polish president to come into force, excludes the recreational use of cannabis.

Lawmakers rejected the possibility to cultivate marijuana for medicinal purposes in Poland, which had been included in the draft legislation.

The bill was tabled last year by Piotr Marzec-Liroy, a rapper-turned-politician who at the time belonged to the Kukiz'15 anti-establishment movement and is now an independent.

An opinion survey conducted in January found that 78 percent of Poles believe access to marijuana should be legal.

Public debate of medicinal pot usage in Poland intensified in 2015 after the controversial firing of a doctor at a Warsaw children's hospital who had administered marijuana to his young epileptic patients on an experimental basis without notifying his superiors.

The debate was then revived last year by the leftist lawmaker Tomasz Kalita, who suffered from brain cancer and later died in January 2017.

Last year the health minister yielded to public pressure and approved refunds of certain specialised treatments involving cannabis-based medicine imported solely at the request of the patient and following special authorisation from the ministry.