Ecstasy, ketamine, and hundreds of other drugs are legal in Ireland for one day only thanks to an accidental loophole in the law, The Journal reports.

Ireland's 1977 Misuse of Drugs Act was found unconstitutional by the Irish Court of Appeal on Tuesday morning — meaning that the drugs prohibited in it are legal.

Drugs now legal in Ireland reportedly include ecstasy, crystal meth, and ketamine. So-called "legal highs" are also no longer prohibited, along with more than 100 other drugs, according to News Talk.

Heroin, cocaine, and cannabis are not affected.

The Irish government is preparing emergency legislation to fix this loophole. But despite lawmakers' sitting late Tuesday night to do so, the law "can only take effect on the day after it's signed into law," according to The Journal, meaning ecstasy will remain legal in Ireland until 12 a.m. Thursday at the earliest.

The Irish government has released a statement acknowledging that while it "does not affect existing laws regarding the supply, possession, or sale" of heroin, cocaine, and cannabis, "it does affect the possession of certain newer psychoative substances."

Opportunistic drug dealers should still be wary, however. "We are advised that the sale and supply of psychoative substances remains an offence under existing legislation," the statement adds.

Here's the full statement: