This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

NEW YORK (AP) — Prosecutors cracked open a trove of emails and other communications at a federal trial on Thursday that they say shows how the former chair of Donald Trump’s inaugural committee worked behind the scenes in 2016 to get the future president to embrace the United Arab Emirates and Saudi Arabia.

Some of the email traffic was between Tom Barrack — accused of working at the direction of the UAE as a secret foreign agent — and Paul Manafort, Trump’s campaign manager at the time. The exchanges focused in part over an energy policy speech by Trump in 2016.

In one email read to the jury by an FBI agent, Barrack complained to Manafort that an original draft of the speech didn’t mention either the UAE or Saudi Arabia, or the importance of their role in the Middle East.

“Wow. I’m just stunned by how bad this is,” the billionaire private equity manager wrote about the draft.

Manafort responded: “Send me an insert that works for our friends.”

The speech Trump gave ended up referring to the need to team with “our supportive Gulf allies” as part of a broader strategy to fight terrorism in the region. Afterward, Barrack received an email from a UAE official congratulating him for doing a “great job.”

In other emails, Manafort assured those in the back-channel network that he would get Trump to tone down his anti-Muslim rhetoric and that he would set up face-to-face meetings between Trump and UAE and Saudi leaders.

Another Barrack email indicated he had lobbied Ivanka Trump and her husband Jared Kushner on Manafort’s behalf to get Manafort the campaign manager post. Manafort was eventually convicted in special counsel Robert Mueller’s Russia investigation and later pardoned by Donald Trump.

Prosecutors say the communications demonstrate Barrack’s efforts to manipulate the Trump campaign and later his administration to advance the interests of the UAE. They say at the same time, the energy-rich Gulf state poured millions of dollars into business ventures operated by Barrack.

Barrack, 75, has pleaded not guilty to charges accusing him of acting as an unregistered agent of a foreign government, obstruction of justice and making false statements.

In his opening statements this week, defense attorney Steven Schachter insisted there was no evidence that Barrack ever took orders from the UAE or betrayed his country by becoming a covert agent.

“Tom Barrack is his own man,” the lawyer said.