PAUL Manafort’s protege has wrapped up his testimony after implicating the former Trump campaign chairman and himself in financial crimes and also enduring stinging attacks on his character and credibility.

Rick Gates has been the government’s star witness in Mr Manafort’s financial fraud trial, testifying how, at the behest of his longtime boss, he helped conceal millions of dollars in foreign income and submitted fake mortgage and tax documents.

Defence lawyers saw an opening to undermine his testimony by painting him as liar and a philanderer, getting him to admit to an extramarital affair and reminding jurors how he had lied to special counsel Robert Mueller’s team while working out a plea deal for himself.

Mr Gates, a married father of four, was asked about an affair he had with a woman in London who he gave an apartment to, calling it a “mistake” that lasted five months and one which his wife is aware of.

“Do you recall telling the Office of Special Counsel you actually engaged in four extramarital affairs?” Downing said, prompting an objection from the prosecution and both sides being called to the judge’s bench for a private discussion.

Mr Downing then reframed his question to ask about Mr Gates’ “secret life” and if it spanned over the fives years in which he admits embezzling money.

“I made many mistakes over many years and I regret them,” Mr Gates said.

The defence asked Mr Gates if he had realised he was facing 200 years in prison,

Mr Gates said he thought it was “only 100 years”, drawing laughter from the courtroom.

The testimony, stretching across three days, created an extraordinary courtroom showdown between the two former Trump campaign aides who were indicted together by Mr Mueller but who have since opted for radically different strategies: Mr Manafort is the lone American charged by Mr Mueller to opt for trial, whereas Mr Gates pleaded guilty and agreed to co-operate by testifying against his former boss.

Neither man was charged in connection with their Trump campaign work, but the trial has nonetheless been a distraction for a president who insists Mr Manafort was treated shabbily and who continues to publicly fume about Mr Mueller’s investigation into potential ties between his associates and the Kremlin.

Prosecutors sandwiched the testimony of Mr Gates around other witnesses who, in sometimes dry and detailed testimony, described Mr Manafort’s lavish spending and use of offshore accounts to stash Ukrainian political consulting fees.

A clothier said he sold Mr Manafort more than $US900,000 in suits, a bookkeeper says she helped disguise foreign income as a loan to reduce Mr Manafort’s tax burden and, on Wednesday, an FBI forensic account said Mr Manafort hid more than 30 offshore accounts in three types of currencies from the IRS. But it was Mr Gates’ testimony that has generated the most drama, as the witness admitted embezzling hundreds of thousands of dollars from his boss, confessed to an extramarital affair and turned in spectacular fashion against a longtime mentor.

Prosecutors relied on Mr Gates to provide first-hand support of the accusations against Mr Manafort.

He told jurors how he disguised millions of dollars in foreign income as loans in order to lower Mr Manafort’s tax bill.

Mr Gates recounted how he and Mr Manafort used more than a dozen offshore shell companies and bank accounts in Cyprus to funnel the money, all while concealing the accounts and the income from the IRS.

Prosecutors sought to soften the blow of the cross-examination by asking Mr Gates to acknowledge his own crimes, including a lie to Mr Mueller’s team in February. But Mr Gates nonetheless faced aggressive questioning by Mr Manafort’s lawyer, Kevin Downing, who at one point asked him, “After all the lies you’ve told and the fraud you’ve committed, you expect this jury to believe you?”

On Wednesday, Mr Downing sought to counter earlier testimony that Mr Manafort had encouraged Mr Gates to deceive authorities by getting Mr Gates to acknowledge that Mr Manafort told him to be truthful about offshore shell companies and bank accounts during a 2014 interview with the FBI.

The interview was part of an FBI investigation that sought to recover assets looted from the Ukrainian government under the rule of former President Viktor Yanukovych.

Mr Gates said under questioning Wednesday that he told FBI agents and Justice Department lawyers about some of the offshore companies that contained millions of dollars in proceeds from their Ukrainian political work.

But prosecutor Greg Andres followed up by suggesting that Mr Gates and Mr Manafort were not fully truthful.

“Did you tell the FBI that there was hidden income in those accounts?” Mr Andres asked.

“No, I did not,” Mr Gates responded.

Once Gates finished testifying, prosecutors returned to trying to make their case through documentary evidence to demonstrate Mr Manafort’s control of offshore bank accounts containing millions of dollars. None of those accounts were reported to the IRS as required by US law.

An FBI forensic accountant, Morgan Magionos, told jurors that bank records from Cyprus, St. Vincent and the Grenadines and the United Kingdom revealed the accounts were connected to Mr Manafort and his associates. She said Mr Manafort’s passport was used to open many of them in US dollars, euros and British pounds.

A man prosecutors say has ties to Russian intelligence was also among the beneficial owners of some of the companies. That man, Konstantin Kilimnik, is charged along with Mr Manafort with witness tampering in a separate case. Mr Gates was also listed as an owner of several of the accounts.

US District Judge T.S. Ellis III has interrupted prosecutors throughout the trial to encourage them to speed things along.

He poked fun at himself on Wednesday as he haggled with the lawyers for 20 minutes over the number and type of charts prosecutors could present during the testimony of the FBI forensic accountant.

“Judges should be patient. They made a mistake when they confirmed me. I’m not very patient, so don’t try my patience,” Mr Ellis said.