On Thursday, President Trump announced the pardon of Dinesh D’Souza, a bombastic, conservative firebrand, known for making outright racist remarks. The case involved campaign contributions made by D’Souza’s mistress at his behest, as well as “nonsense” claims by D’Souza that he was targeted by the Justice Department for his attacks on President Obama.

D’Souza pleaded guilty in 2014 to campaign finance violations for a scheme in which he used his mistress and assistant as straw donors to contribute $10,000 to the Republican candidate running against U.S. Senator Kirsten Gillibrand (D-NY).

The Republican, Wendy Long, was kept in the dark about the source of the payments, according to the indictment, despite her repeated questions to D’Souza about where they came from.

In 2012, D’Souza and his wife made a $10,000 contribution — $5,000 each, the legal limit — to Long. He then urged his assistant, Tyler Vawser, and a woman described as his lover, Denise Odie Joseph, to make $10,000 contributions in their and their spouses’ names. D’Souza eventually admitted, when pleading guilty, that Vawser and Joseph made the contributions with the understanding that they’d be paid back by D’Souza. (Joseph actually made a $15,000 contribution, $5,000 of which was returned by the campaign.)

Among the evidence prosecutors had was a secret recording Joseph’s husband made of Joseph telling him months before D’Souza was arrested that, if caught, D’Souza might eventually plead guilty.

However, D’Souza would first plead not guilty, Joseph told her husband, to provide “a window of opportunity to get his story out there,” according to the prosecutors.

As the case proceeded, there was some confusion about D’Souza’s relationship status with both women involved. D’Souza’s affair with Joseph had first been reported by the Christian magazine World in 2012, which caught D’Souza — then the president of a Christian college — checking into a hotel with Joseph. He said at the time that Joseph was his fiancée and that he “had no idea that it is considered wrong in Christian circles to be engaged prior to being divorced.” Prosecutors, however continued to describe Joseph as a “woman with whom D’Souza was romantically involved” and the other woman as his wife. D’Souza, after the charges were brought in 2014, declined to clarify whether he was married to either woman.

Dixie D’Souza would eventually write a letter to the court that said Dinesh D’Souza had a “flawed character and lack of truthfulness.”

In the pretrial proceedings, D’Souza’s lawyers claimed that he was the target of prosecutors “because of his consistently caustic and highly publicized criticism” of President Obama. D’Souza had become a cult hero among the far-right for his anti-Obama books and films. One of his biggest cheerleaders when the charges were brought was Sen. Ted Cruz (R-TX), then a rising Tea Party star, who also on Thursday celebrated Trump’s pardon announcement.

D’Souza himself, in a 2014 interview with Sean Hannity, floated the idea that the charges were “kind of payback” for the anti-Obama film D’Souza made, which he claimed “seem[ed] to have gotten under President Obama’s skin.”

The prosecutors, led by then-Manhattan U.S. Attorney Preet Bharara, denied the allegations of political bias, and told the court that D’Souza was “exploiting” his criticisms of Obama in a “baseless attempt to avoid criminal prosecution.”

U.S. District Judge Richard Berman sided with the prosecutors in the pretrial dispute, with the judge later calling D’Souza’s claims “nonsense”.

D’Souza’s guilty plea came unexpectedly in March 2014, on the same day trial was set to start.

“I knew that causing a campaign contribution to be made in the name of another was wrong and something the law forbids,” he said at his plea hearing.

He was sentenced to eight months in a community confinement center, five years probation and a $30,000 fine.

A statement released by his attorney after the plea deal claimed that D’Souza’s illegal contributions were “an act of misguided friendship” toward Long.