When the lead prosecutor for the special counsel’s office, Greg D. Andres, objected, challenging the relevance of the question, Mr. Downing asserted that Mr. Gates may have lied about the number of affairs under oath, which could invalidate his plea agreement.

Mr. Gates pleaded guilty in February to lying to federal investigators and conspiracy to commit fraud, but he has yet to be sentenced. Under federal sentencing guidelines that the judge is not required to follow, his plea would result in a prison sentence of four years and nine months to six years. But as part of his testimony, Mr. Gates said prosecutors have agreed not to object if his defense lawyer argues that he should receive probation. The most serious of the 18 felony charges against Mr. Manafort carry a maximum of 30 years in prison.

Mr. Manafort and Mr. Gates had been quite close. Mr. Manafort, 69, served as both a boss and mentor for Mr. Gates, 46. When Mr. Manafort was brought on to help run the Trump campaign, he brought on Mr. Gates as his deputy. When Mr. Manafort was forced out amid allegations about his work in Ukraine, Mr. Gates continued working with the campaign, and then served as the executive director of Mr. Trump’s inaugural committee.

Mr. Manafort’s allies regarded Mr. Gates’s decision to cooperate with prosecutors as an ultimate betrayal.

Over three days of testimony this week, Mr. Manafort glared continuously at Mr. Gates in the witness box, his fists perched underneath his chin. Mr. Gates kept his gaze fixed on the floor in front of him.

Mr. Gates provided hours of damning testimony against Mr. Manafort related to their decade of work together on behalf of Russia-aligned Ukrainian politicians and oligarchs. Mr. Gates accused Mr. Manafort of deliberately hiding income from the Ukraine work in foreign bank accounts to evade federal taxes, as well as personally directing the falsification of financial statements to obtain bank loans.

The defense, in response, has worked to cast Mr. Gates, not Mr. Manafort, as the driving force behind the financial improprieties. Another defense lawyer seemed to suggest on Wednesday that Mr. Gates may have forged his boss’s signature on documents related to foreign bank accounts that the special counsel says were used to hide income.