Washington (AFP) - Saying he was treated "very unfairly," President Donald Trump announced Thursday that he will pardon conservative author and filmmaker Dinesh D'Souza, who pleaded guilty four years ago to violating US campaign finance laws.

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

D'Souza, 57, a caustic critic of former president Barack Obama and Hillary Clinton, was fined $30,000 and sentenced in September 2014 to five years of probation for making illegal campaign contributions.

The Republican pundit and provocateur pleaded guilty to attempting to donate $20,000 to a Senate campaign through straw donors by offering to reimburse associates who sent in the money.

D'Souza also personally contributed $10,000 to the campaign of Republican Wendy Long, who ran unsuccessfully for Senate in New York in 2012.

At the time, the legal limit for an individual contribution was $5,000.

D'Souza told Fox News that Trump called him on Wednesday to tell him he would be pardoned.

"I am thrilled and relieved and elated and as an immigrant in America, my American dream has been under something of a cloud, so I'm very relieved to have that cloud lifted," D'Souza told Fox News.

"President Trump told me he felt I had been treated very unfairly and he felt that I was an important voice for America," D'Souza said. "He wanted to clean my record and adhere to continue doing what I'm doing."

D'Souza is a best-selling author of several books critical of the American left and the influence of religion on US society.

His 2010 book "The Roots of Obama's Rage" was made into a film, "2016: Obama's America," which was popular with conservative groups.

He also made a documentary about Clinton -- "Hillary's America: The Secret History of the Democratic Party."

- 'Voluntarily pled guilty' -

Before pleading guilty in 2014, D'Souza insisted on his innocence and claimed he was targeted for federal prosecution because of his anti-Obama views.

Story continues

Judge Richard Berman dismissed the bias claims as completely unfounded. "The defendant's claim of selective prosecution, legally speaking, is all hat, no cattle," he said.

Former US attorney Preet Bharara defended D'Souza's conviction on Thursday.

"The President has the right to pardon but the facts are these," Bharara said on Twitter. "D'Souza intentionally broke the law, voluntarily pled guilty, apologized for his conduct & the judge found no unfairness."

Trump has granted five pardons since taking office including one to Joe Arpaio, a Trump supporter who was convicted of contempt of court for racially profiling Hispanics while serving as a sheriff in Arizona.

Trump also pardoned Lewis "Scooter" Libby, former vice president Dick Cheney's chief-of-staff who was convicted of obstruction of justice and perjury, and Kristian Saucier, a US Navy sailor convicted of taking photos inside a nuclear submarine without permission.

Last week, Trump issued a posthumous pardon to Jack Johnson, the first black heavyweight boxing champion, who was sent to prison a century ago in a racially charged case.

Republican Senator Ted Cruz of Texas welcomed Trump's announcement that he intended to pardon D'Souza.

"Bravo! @realDonaldTrump," Cruz tweeted. "Dinesh was the subject of a political prosecution, brazenly targeted by the Obama administration bc of his political views."

D'Souza came in for criticism recently for a tweet mocking student survivors of the February 14 school shooting in Parkland, Florida.

"Worst news since their parents told them to get summer jobs," D'Souza tweeted next to a photo of students disappointed by the Florida legislature's failure to approve a ban on assault weapons.