Mr. Gates’s testimony, eagerly anticipated since the trial began a week ago, was crucial to the prosecution’s effort to show that Mr. Manafort knowingly defrauded tax and bank authorities and had not simply been tripped up by lazy accountants or confusion about complex tax laws. Mr. Gates testified, for instance, that in October 2016, Mr. Manafort personally falsified a profit-and-loss statement for his firm while seeking to secure a bank loan.

In an email, Mr. Gates said, Mr. Manafort sought advice on editing the statement, asking, “How do I convert the PDF into a Word document?” Mr. Gates said Mr. Manafort then changed the document to show that his firm had $3 million in profit instead of more than $600,000 in losses.

He also testified that Mr. Manafort had personally ordered money wired from bank accounts in Cyprus to pay clothiers, landscapers and other expenses in the United States. He said Mr. Manafort’s accountants were never told of those payments — evidence, prosecutors claim, of millions of dollars in illegally concealed income — because “Mr. Manafort said we did not need to.”

But Mr. Gates also demonstrated his own facility at falsifying documents, referring to what prosecutors said was blatant fraud in bland terms. He referred to invoices he altered for Mr. Manafort as “modified” and said that changes to Mr. Manafort’s financial documents sometimes required him to “update” or “edit the template.”

When Mr. Manafort needed false loan documents — either to reduce his reported income to evade taxes or to inflate it to obtain bank loans — Mr. Gates said he called upon a law firm in Cyprus, run by a man nicknamed Dr. K., to help him create the fakes.

His confident delivery turned stumbling when Mr. Manafort’s defense lawyer began delving into financial schemes that Mr. Gates executed for his own benefit, not Mr. Manafort’s. Asked how much of his own income he had illegally hidden from tax authorities, for instance, he said he could not come up with a figure, but had told prosecutors that he did not disclose it all.

Pressed on how he stole $125,000 from one of Mr. Manafort’s accounts, Mr. Gates repeatedly described his transfers of funds for fake expenses as “unauthorized.” When Mr. Downing demanded to know why he refused to use the term “embezzlement,” Mr. Gates replied that Mr. Downing could use “whatever word” he wanted, before finally acknowledging that “it was embezzlement from Mr. Manafort.”