She was prepared to testify against D’Souza regarding the contributions, a prosecutor said. She had told federal investigators that D’Souza lied to her about the source of donations made to her campaign, a prosecutor had said in January.

His plea came the day his trial was to begin. The plea agreement calls for a sentence of 10 to 16 months in prison.

D’Souza, who made the anti-President Barack Obama documentary “2016: Obama’s America,” said he knew what he did was wrong and illegal and that he deeply regrets it.

D’Souza is a former policy analyst under President Ronald Reagan. “2016: Obama’s America” was condemned by critics before it became one of the most successful political documentaries ever released, grossing more than $32 million.

In October 2012, D’Souza resigned as head of an the King’s College, a small evangelical college in Lower Manhattan, after becoming engaged to a woman while still married to his wife.