President Donald Trump on Thursday announced that he had pardoned conservative commentator, filmmaker and author Dinesh D'Souza.

In 2014, D'Souza was sentenced to eight months in a halfway house near his San Diego home and five years probation, and fined $30,000 for making an illegal contribution to the 2012 Senate campaign of Wendy Long.

Trump said he pardoned D'Souza because he was treated “very unfairly.”

D'Souza has a history of making anti-LGBT and racist comments, including stating that the Supreme Court's Obergefell ruling, which struck down state bans on same-sex marriage, was “dangerous.”

“As a consequence of the gay marriage ruling,” he tweeted in 2015, “the danger to religious freedom is not immediate, but it is very real – so we better get ready!”

“Oh great!” he messaged after the decision was released. “Now we're going to see a plethora of gay propaganda shoved in our faces #SCOTUSMarriage.”

In his 2007 book The Enemy at Home, D'Souza suggested that 9/11 was a response to increasing support for LGBT rights in the United States. “[W]ithout the cultural left, 9/11 would not have happened,” he wrote.

During the 2016 election, D'Souza repeated Trump's claim that he was a better “friend” to the LGBT community than Hillary Clinton, the Democratic nominee, because he was tougher on terrorism.

“So are we still going to hear gay activists say they are more threatened by conservative Christians than radical Muslims?” he rhetorically asked.

“I would really like to see these gays try their bullying tactics on MUSLIMS! Just to see what happens!” he also tweeted.

LGBT rights advocate GLAAD said in a statement that D'Souza's views on LGBT rights were in line with those of the Trump administration.

“Dinesh D’Souza, who has blamed LGBTQ people in part for the tragic attacks on our nation on 9/11, may reflect the values of President Trump, but he does not reflect the values of this nation,” said Zeke Stokes, vice president of programs at GLAAD. “There is simply no place in our discourse for this ignorance and hate that we hear all too often being espoused by members of the Trump Administration and its surrogates.”

Last year, Trump pardoned Arizona Maricopa County Sheriff Joseph Arpaio.

(Related: LGBT groups condemn Trump's pardon of Joe Arpaio.)