Updated at 4:05 p.m. June 1 with comment from Texas Sen. Ted Cruz.

WASHINGTON — Texas Sen. Ted Cruz is acknowledging his role in helping secure a presidential pardon for conservative writer and family friend Dinesh D'Souza, a day after President Donald Trump said "nobody asked" him to do it.

Cruz, whom D'Souza credited with approaching Trump about the pardon announced on Thursday, told reporters in Texas on Friday that he spoke with the president about it when Trump was in Dallas for the National Rifle Association meeting in early May.

According to The Texas Tribune, Cruz said the conversation came weeks after Trump granted a pardon for Scooter Libby, a former top aide to Vice President Dick Cheney who was convicted of lying to the FBI in 2007.

"He had just pardoned Scooter Libby, who I think Scooter likewise had faced an unfair prosecution," Cruz said, according to the Tribune. "I think that pardon was the right thing to do, and so in the car ride, I said, 'You know, Mr. President, another pardon very much along the same lines of Scooter Libby would be Dinesh D'Souza, who I think was unfairly politically targeted.' And the president agreed."

D’Souza, a well-known Barack Obama tormentor, pleaded guilty to campaign finance fraud in 2014. He admitted making illegal contributions to a U.S. Senate candidate in New York but has said he was wrongly targeted by the Obama administration for his conservative views.

“He was treated very unfairly by our government!” Trump declared in announcing the decision on Twitter early Thursday, a stance he reiterated to reporters aboard Air Force One as he flew to Houston hours later.

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

Asked about the pardon, Trump did not acknowledge Cruz and said “nobody asked me to do it.”

“I’ve always felt he was very unfairly treated. And a lot of people did, a lot of people did,” he said of D'Souza. “What should have been a quick minor fine, like everybody else with the election stuff ... what they did to him was horrible."

On Thursday, deputy press secretary Hogan Gidley told reporters that he was "not aware of any conversations" between the president and Cruz on the subject of the D'Souza pardon. He said Trump "knew about the case" but did not offer further details.

In an interview with the conservative news outlet The Daily Caller, D'Souza said that, during dinner with Cruz about a month ago, the Texas Republican told him he'd push Trump to consider a presidential pardon. In recent days, he said, Cruz told him that Trump was open to the idea.

Bravo! @realDonaldTrump Dinesh was the subject of a political prosecution, brazenly targeted by the Obama administration bc of his political views. And he’s a powerful voice for freedom, systematically dismantling the lies of the Left—which is why they hate him. This is Justice. https://t.co/cGHzcgwSnK — Ted Cruz (@tedcruz) May 31, 2018

D'Souza's wife, Debbie D'Souza, took to Twitter to thank Trump, as well as Cruz for "putting it on [Trump's] radar and helping make it happen" — further corroborating that version. The couple has close ties to the Cruz family. Cruz's father, Rafael Cruz, officiated the D'Souzas' wedding in March 2016. The writer and filmmaker's prior marriage ended a few years earlier amid scandal.

A spokeswoman for Cruz acknowledged that the senator raised the pardon issue with the president but declined to give specifics.

The Texas Republican, who is seeking a second term in November, did not initially claim credit for any role in the decision on Thursday, but praised the move and retweeted Debbie D'Souza's statement.

A terrific day for Justice. @realDonaldTrump stood strong and did the right thing, and Heidi and I are celebrating with you and Dinesh. https://t.co/2RRbLaVu52 — Ted Cruz (@tedcruz) May 31, 2018

D’Souza told The Daily Caller that Cruz was among a number of people advocating on his behalf.

D’Souza, who was sentenced to five years of probation and fined $30,000 for his crime, is known for making provocative statements, especially about former President Obama and first lady Michelle Obama.

He once tweeted a photo of Obama taking a selfie and wrote "you can take the boy out of the ghetto" before describing the president as "vulgar." He has said that Ivy League-educated Michelle Obama benefited from being part of the "affirmative action generation."

In recent months, he was widely criticized for mocking Parkland, Fla., school shooting survivors who wept when the Florida legislature voted down a proposed ban on so-called assault weapons. D'Souza called it "the worst news since their parents told them to get summer jobs" and later apologized.

Worst news since their parents told them to get summer jobs https://t.co/Vg3mXYvb4c — Dinesh D'Souza (@DineshDSouza) February 20, 2018

He gloated after the pardon was announced on Thursday, noting that Trump fired the prosecutor in his case, Preet Bharara, the former U.S. attorney in Manhattan.

KARMA IS A BITCH DEPT: @PreetBharara wanted to destroy a fellow Indian American to advance his career. Then he got fired & I got pardoned — Dinesh D'Souza (@DineshDSouza) May 31, 2018

Bharara also weighed in on Trump's decision, tweeting "the president has the right to pardon but the facts are these: D'Souza intentionally broke the law, voluntarily pled guilty, apologized for his conduct & the judge found no unfairness. The career prosecutors and agents did their job. Period."

The President has the right to pardon but the facts are these: D'Souza intentionally broke the law, voluntarily pled guilty, apologized for his conduct & the judge found no unfairness. The career prosecutors and agents did their job. Period. https://t.co/bA3I8vs4QQ via @politico — Preet Bharara (@PreetBharara) May 31, 2018

Last week, Trump awarded a posthumous pardon to heavyweight boxing champion Jack Johnson, a Texan convicted by an all-white jury in 1913 for violating the Mann Act by traveling with his white girlfriend across state lines. The law prohibited transporting women across state lines for "immoral purposes."

Trump said he's also considering commuting the 14-year sentence for former Illinois Gov. Rod Blagojevich, a Democrat who tried to sell a U.S. Senate appointment, and for Martha Stewart, who spent time in prison related to a case involving insider trading. Both were former contestants on Trump's reality television show, The Apprentice.

In discussing the former governor's sentence, Trump erroneously described it as 18 years in saying the punishment is "really unfair for being stupid and saying things that every other politician, you know, that many other politicians say."