President Trump announced on Twitter Thursday that he'll give a full pardon to conservative author and documentary filmmaker Dinesh D'Souza, who pleaded guilty in 2014 to a campaign finance violation.

"Will be giving a Full Pardon to Dinesh D'Souza today," Mr. Trump tweeted. "He was treated very unfairly by our government!"

Will be giving a Full Pardon to Dinesh D’Souza today. He was treated very unfairly by our government! — Donald J. Trump (@realDonaldTrump) May 31, 2018

In 2014, then-U.S. Attorney Preet Bharara charged D'Souza with using "straw donors" to contribute funds to Wendy Long, a Republican who ran for Senate in New York against Democratic incumbent Kirsten Gillibrand in 2012. D'Souza then pleaded guilty to one count of making illegal contributions in the names of others.

Get Breaking News Delivered to Your Inbox

"I knew that causing a campaign contribution to be made in the name of another was wrong and something the law forbids," D'Souza, who had previously argued that he was a victim of selective prosecution, told the judge in the case. "I deeply regret my conduct."

D'Souza was sentenced to eight months in a halfway house and five years of probation. He also received a $30,000 fine.

D'Souza made the 2012 anti-Obama documentary "2016: Obama's America," which was given poor reviews by many critics, but has become one of the most successful political documentaries ever released, grossing more than $32 million. In 2016, he released "Hillary's America," which was criticized by historians and received similarly poor reviews from critics.

Before he started making documentaries, D'Souza was a prominent conservative writer and pundit, and was briefly president of a Christian college in New York. He has since become an outspoken supporter of Mr. Trump.

This is Mr. Trump's fifth pardon since taking office. He has also granted one commutation of sentence.

In August 2017, he pardoned Sheriff Joe Arpaio, who had been convicted of criminal contempt of court.

This year, in March, he pardoned former Navy sailor Kristian Saucier, who was convicted of taking photos of classified portions of a U.S. nuclear submarine.

Lewis "Scooter" Libby, former chief of staff for Vice President Cheney, convicted on perjury and obstruction of justice in CIA leak case disclosing identity of CIA officer Valerie Plame Wilson, was pardoned in April.

And in late May, Mr. Trump granted a full pardon to legendary boxer Jack Johnson, who was convicted and imprisoned for 10 months for a Mann Act violation in 1913.

Dinesh D'Souza voiced his thanks on Twitter to those who reached out and supported him.

My heartfelt thanks to those who prayed for me, supported me & reached out on social media to President Trump to pardon me — Dinesh D'Souza (@DineshDSouza) May 31, 2018

CBS News' Mark Knoller contributed to this report.