Without a parting glance, Rick Gates left the witness stand Wednesday after three days of testimony that prosecutors hope will seal a guilty verdict against Paul Manafort, his former boss, on tax and bank fraud charges.

Gates, the star witness at Manafort’s trial in Alexandria, Va., portrayed him as a demanding boss who directed a years-long scheme to hide millions of dollars from the Internal Revenue Service in foreign bank accounts, and use that money to spend a fortune on expensive suits, properties and home entertainment systems. Gates also admitted to embezzling hundreds of thousands of dollars from Manafort with phony invoices and padded expenses.

The case is a critical public test of the work done by special counsel Robert S. Mueller III, as Manafort is the first person charged by Mueller’s team to go to trial. More than a dozen witnesses have told the court how Manafort and Gates, two political consultants who held senior positions in Donald Trump’s 2016 presidential campaign, spent years stashing cash overseas and living beyond their means.

Manafort’s defense strategy has been to blame Gates for any wrongdoing.

Defense lawyer Kevin Downing took one final shot at Gates before he left the witness stand Wednesday, accusing him of engaging in more marital infidelity than Gates acknowledged earlier. Under previous questioning, he admitted to a transatlantic affair 10 years ago.

Downing asked if Gates had told the special counsel’s office that “you actually engaged in four extramarital affairs.” The attorney appeared to be trying to show that even in his court testimony, Gates was still not telling the full truth. But after a long sidebar before U.S. District Judge T.S. Ellis III, Downing asked a different question, whether Gates’s “secret life” continued into the 2010-2014 time period.

In testimony for the trial of former Trump campaign manager Paul Manafort, Rick Gates admitted Aug. 7 to embezzlement and having an extramarital affair. (Rachel Weiner, Patrick Martin, Melissa Macaya/The Washington Post)

Those are the years prosecutors have focused on in trying to prove that Manafort hid about $15 million in income from the IRS.

“Mr. Downing, I’d say I made many mistakes, over many years,” Gates answered. He later conceded that he lived the “secret life” during those years.

Gates worked for Manafort for more than a decade before the pair were indicted last year on bank fraud and tax charges. In February, Gates pleaded guilty to lying to the FBI and conspiring against the United States. Under sentencing guidelines, he could receive about five to six years in prison for those crimes, but he said he hopes his cooperation with the government will result in less time.

Although the Manafort trial grew from the special counsel investigation of Russian interference in the 2016 election and whether any Trump associates conspired with those efforts, those issues are not part of these proceedings.

When the questioning of Gates ended about 11 a.m. Wednesday, he was dismissed from court. He did not look at Manafort as he left.

During and after Gates’s testimony, Ellis continued to spar with prosecutors, a daily occurrence during the trial.

The judge argued with prosecutors over a chart the FBI had prepared. Ellis has repeatedly pressed prosecutors to accelerate their case, and he said such charts would only slow things.

“We need to find a way to focus sharply,” the judge said.

“We’ve been focused sharply for a long time,” prosecutor Greg Andres replied.

Ellis ended the argument with a joke. “Judges should be patient,” he said. “They made a mistake when they confirmed me.”

The judge berated prosecutors again when he learned that their next witness — IRS agent Michael Welch — had been watching the trial from the gallery.

Prosecutors asked the judge to allow Welch as an expert witness — meaning that he, unlike other witnesses, would be allowed to offer the jury his professional opinion. Assistant U.S. Attorney Uzo Asonye then revealed that Welch had been seated in the courtroom for the duration of the proceedings.

Ellis erupted, saying that he typically bars all witnesses — save the case agent — from observing and that he thought he had done so in this case.

“I want you to remember, don’t do that again. When I exclude witnesses, I mean everybody,” Ellis said. When Asonye pointed out that the judge had previously said the expert could stay in the courtroom, the judge snapped: “I don’t care what the transcript said; maybe I made a mistake. Don’t do it again.”

Manafort, Welch testified, paid more than $15.5 million to vendors between 2010 and 2014, without reporting and paying taxes on that money. Manafort also falsely classified other income as loans, Welch said.

The IRS agent said that figure was a conservative estimate and did not include possible business expenses such as 132,000 euros to a yacht company, $49,000 for an Italian villa rental, $45,000 for cosmetic dentistry and $19,800 for a riding academy.

Even under that conservative analysis, he said, Manafort did not report millions of dollars in offshore income.

That accounting was based on the work of FBI forensic accountant Morgan Magionos, who found 31 foreign bank accounts from 2010 to 2014 that listed Manafort, Gates or Manafort’s longtime employee Konstantin Kilimnik as the beneficial owners of those accounts. They kept those accounts in Cyprus until about 2013, when a banking crisis on that island led them to move their money to accounts in St. Vincent and the Grenadines.

Prosecutors have said they expect to wrap up their case Friday.

Tom Jackman contributed to this report.