It is now legal to possess drugs like ecstasy, crystal meth, ketamine and magic mushrooms (containing psilocybin) in Ireland, after the Irish Court of Appeal struck down a law banning these substances early on Tuesday. However, the ban will soon be back in place as the government rushes to sign a new emergency legislation on Wednesday.

A section of Ireland’s 1977 Misuse of Drugs Act, which allows certain drugs to be listed as controlled, was ruled unconstitutional by the court after it found that a number of substances had been added to the list in 2010 without consulting the Oireachtas (the two houses of Irish parliament). As a result of the ruling, all government orders banning these drugs were automatically declared void. However, the legal loophole does not affect laws regarding the supply, possession and sale of more established drugs such as marijuana, heroin or cocaine, according to media reports. 

Within hours of the court ruling, Ireland’s Minister for Health Leo Varadkar introduced a new emergency bill to reinstate the ban, according to media reports. The bill was passed by the Dail (lower house of parliament) and will now have to be approved by the Seanad (upper house) before being signed into law by the country’s president.

“We had no way of knowing what the Court would decide today, but we prepared for this possibility. Legislation was prepared and approved in advance by Cabinet,” Varadkar said, in a statement released after the ruling, adding that the purpose of the “short but important” bill was to reaffirm the ban on the substances, commonly known as “head shop” drugs.

However, because the new bill reportedly includes a provision that it can only take effect from the day after it is signed, no one can be arrested for possession of these drugs until Thursday at the earliest.