Dinesh D’Souza, the controversial conservative writer and filmmaker, has pleaded guilty to making illegal campaign contributions, in connection with a scheme to get around limits on money in politics, Reuters reported.

D’Souza admitted in a plea deal that he got two close associates to contribute $10,000 each to the campaign of Wendy Long, a Republican lawyer who was challenging Sen. Kirsten Gillibrand (D-N.Y.), and who was a friend of D’Souza. D’Souza told the associates—one of whom was a woman to whom he had been engaged—that he would then reimburse them.

“I knew that causing a campaign contribution to be made in the name of another was wrong and something the law forbids,” D’Souza, 53, told a federal judge. “I deeply regret my conduct.”

The plea deal calls for a sentence of 10 to 16 months in prison.

Some conservatives had suggested that the prosecution of D’Souza was a politically motivated effort to target a prominent critic of President Obama. D’Souza’s 2012 film, 2016: Obama’s America, aimed to make the case that Obama’s childhood experiences as the son of a Kenyan father instilled a profound hatred of the west in him, which has influenced his actions as president.