Florida Rep. Matt Gaetz on Wednesday said he apologized to Michael Cohen following his since-deleted tweet a day earlier that suggested President Trump’s former attorney had been unfaithful to his wife.

“I’ve personally apologized to @MichaelCohen212 4 referencing his private family in the public square,” Gaetz tweeted. “Regardless of disagreements, family members should be off-limits from attacks from representatives, senators & presidents, including myself. Let’s leave the Cohen family alone.”

The comment from the Republican lawmaker was an about-face from his initial tweet directed at Cohen, which asked whether his “wife & father-in-law know about your girlfriends?”

FLORIDA BAR OPENS INVESTIGATION INTO REP. GAETZ’S TWEET ABOUT MICHAEL COHEN

“Maybe tonight would be a good time for that chat. I wonder if she’ll remain faithful when you’re in prison. She’s about to learn a lot...,” it continued.

He posted the remark as Cohen appeared on Capitol Hill Tuesday for the first in a series of hearings this week.

On Wednesday, Cohen testified in an open hearing before the House Oversight Committee. He also testified Tuesday before the Senate Intelligence Committee, and on Thursday, he’s slated to appear before the House Intelligence Committee.

Cohen was sentenced in December to three years in prison after pleading guilty to campaign finance violations, tax evasion and lying to Congress. He agreed to cooperate with prosecutors as part of a deal.

Lanny J. Davis, who represents Cohen, slammed Gaetz’s initial tweet at the time as a shameful lie and one that would not sit well with the Floridians whom the lawmaker represents.

"We will not respond to Mr. Gaetz’s despicable lies and personal smears, except to say we trust that his colleagues in the House, both Republicans and Democrats, will repudiate his words and his conduct,” Davis said in a statement to Fox News.

CLICK HERE TO GET THE FOX NEWS APP

Gaetz’s act of contrition followed a separate apology he issued Tuesday night, which came after House Speaker Nancy Pelosi issued a word of caution to all members to be “mindful” about social media comments and how they could impact the work of House Committees.

Gaetz at the time tweeted that it wasn’t his “intent to threaten” by posting the controversial tweet. He added that he should’ve expressed his point better.

Fox News’ Stephen Sorace and Alex Pappas contributed to this report.