President Donald Trump announced unexpectedly Thursday that he was granting a full pardon to Dinesh D'Souza, the conservative author and filmmaker who pleaded guilty to violating federal campaign finance laws in 2014. He was indicted earlier that year on charges that he illegally used straw donors to contribute to Republican Senate candidate Wendy Long in New York in 2012.

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

The 57-year-old was sentenced to five years of probation, including eight months living under supervision in a "community confinement center" and a $30,000 fine.

D'Souza is a contentious figure who once accused former President Barack Obama of adopting "the cause of anti-colonialism" from his Kenyan father in a Forbes magazine cover story when Obama was in office. Though past presidents have waited until the end of their term for controversial pardons, Trump has pardoned several people during his 16 months in office, including former Vice President Dick Cheney's chief of staff "Scooter" Libby and former Arizona sheriff Joe Arpaio.

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

The-CNN-Wire ™ & © 2018 Cable News Network, Inc., a Time Warner Company. All rights reserved.