By AHMED JALLOW

Reza Zarrab, the star witness in a billion-dollar scheme that U.S. prosecutors said violated sanctions against Iran, ended his testimony on Thursday at the federal court in Manhattan.

Zarrab, 34, a Turkish-Iranian gold trader who is accused of smuggling gold for oil in violations of U.S. sanctions on Iran, agreed to cooperate with U.S. prosecutors against a Turkish banker, Mehmet Hakan Atilla, who is standing trial for his alleged involvement in the scheme.

 In his seven days testimony, Zarrab detailed a sophisticated corruption and bribery scheme that involved the now president of Turkey Recep Tayyip Erdogan and other senior Turkish officials.

Erdogan has repeatedly condemned the trial as a plot by his enemies to destabilize Turkey and his presidency.

Zarrab’s decision to cooperate with U.S. prosecutors has angered Turkish officials who had moved to confiscate his assets –and that of 18 others—back home.  Some of the assets seized were yachts and houses.

“All my assets were seized by the Republic of Turkey…,” he said. “It is as if I have obtained all the assets based on my cooperation here. I don’t understand,” he added.

Zarrab also revealed in court that his life had been threatened by a fellow inmate who said that “he was instructed to kill me [Zarrab] because I was cooperating.”

This threat prompted the F.B.I. to move Zarrab from the Brooklyn jail he had been held to an undisclosed location.

In a separate lawsuit that came to light on Thursday, Zarrab was sued by an inmate who claimed Zarrab sexually assaulted him when both men shared a cell in Metropolitan Correctional Center, in Manhattan.

Jail officials conducted an investigation into the matter but found the complaint to be unsubstantiated.

After they grilled him about the lies he had told in the course of his life and career, defense lawyers asked Zarrab, “What happens if you lie about Atilla?”

“I would be the worst thing to happen to my life,” Zarrab said.