Asim Ghafoor, an American lawyer detained in the United Arab Emirates since mid-July, was released early Saturday, concluding an effort by members of U.S. Congress and Muslim advocacy groups to free him. They had raised concerns that he was being politically targeted because of his ties to Jamal Khashoggi, a murdered Saudi journalist.

The UAE had detained Ghafoor in July after convicting him in absentia of money laundering and tax evasion. He had been at the airport in Dubai awaiting a flight to Istanbul.

His sentence was three years, to be followed by deportation, in addition to a fine of $1.36 million and confiscation of the money the court said he had transferred illegally through the country: about $4.9 million.

But an Emirati court revoked his jail term Wednesday after Ghafoor appealed, although it upheld his conviction.

Ghafoor’s lawyer, Faisal Mahmood Gill, said Saturday that he had been released after paying the fine and was on a flight back to the United States. Ghafoor is currently not the target of any investigation and will return to practicing law, Gill added.

“We were not happy to see he was detained in the first place,” Gill said in a phone interview, “but we’re happy that they freed him.”