Dubai police arrested an American man after traces of marijuana which he had smoked legally in U.S. soil before traveling to the United Arab Emirates city were found in his urine sample, Fox News reported Monday.

Peter Clark, 51, flew to Dubai from Las Vegas Feb. 24 where he was due to spend a few days searching for professional recording studios.

He said he smoked marijuana three days before leaving for a business trip to the Gulf.

However, he suddenly fell ill with pancreatitis and was admitted for emergency treatment where doctors detected hashish in his urine and reported Clark to the authorities, as part of the emirate's law.

Hashish, also known as hash, is a drug made from compressed trichomes of the cannabis plant. The traces of hash found in Clark's urine is considered possession in the UAE.

Marijuana was legalized for recreational use in Nevada in 2017 and Clark said he was aware of Dubai's strict drugs laws and made sure he did not have any marijuana or other drugs with him when he flew to the emirate.

"I knew about Dubai's strict drugs laws but never for one moment did I think something I legally did in my own country would lead to my arrest," OneMileAtATime.com quoted Clark as saying.

"This has just turned into a complete nightmare. I never thought by going to hospital I would end up being thrown in a jail," he said.

Clark was arrested March 3 and spent three days in a "flea-ridden cell" before he was allowed back to his hotel, where he awaits the authorities' decision.

According to Radha Stirling, Clark's lawyer, even if found innocent, he can be dragged through a slow and costly legal process.

If found guilty, Clark could face up to four years in jail.