The Florida Bar opened an investigation into U.S. Rep. Matt Gaetz after the Panhandle Republican aimed a menacing social media message at Michael Cohen on the eve that President Donald Trump’s former lawyer was to testify before Congress.

“The Florida Bar is aware of the comments made in a tweet yesterday by Rep. Matt Gaetz,” spokeswoman Francine Andía Walker said Wednesday, “and I can confirm we have opened an investigation.”

She could not provide other details on Gaetz’s case, but said: “If rules have been violated, the Florida Bar will vigorously pursue appropriate discipline by the Florida Supreme Court. The Florida Bar takes its responsibility of regulating lawyer conduct very seriously.”

Gaetz, a Panhandle Republican who has been an ardent — if not gleeful — defender of Trump, is a lawyer and member of the Florida Bar.

RELATED: Did Matt Gaetz just threaten Michael Cohen right before he testifies to Congress?

Matt Gaetz apologizes and deletes tweet about Michael Cohen

On Tuesday, Gaetz tweeted at Cohen: “Do your wife & father-in-law know about your girlfriends? 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...”

The tweet went viral, immediately drawing a rebuke from legal experts, who compared it to intimidation of a witness. Walter Schaub, the former director of the Office of Government Ethics replied to Gaetz’s tweet with the federal statute number for tampering with a witness.

At first, Gaetz defended the tweet. When asked by a Vox reporter to respond to charges that he was tampering with witnesses, he replied back that he was “witness testing.”

“We are still allowed to test the veracity and character of witnesses, I think,” he told Vox.

But later Tuesday night, Gaetz, R-Fort Walton Beach, said that he “should have chosen words that better showed my intent. I’m sorry.” However, he maintained that he was not attempting to threaten Cohen.

The apology followed a reminder posted by House Speaker Nancy Pelosi to “be mindful that comments made on social media or in the press can adversely affect the ability of House Committees to obtain the truthful and complete information necessary.”

After news of the Florida Bar investigation broke Wednesday afternoon, Gaetz’s office quickly shrugged it off.

“It seems that the Florida Bar, by its rules, is required to investigate even the most frivolous of complaints,” chief of staff Jillian Lane Wyant said in a statement.

Cohen testified before the House Oversight Committee on Wednesday in a marathon hearing about his relationship with Trump and the Trump Organization. Cohen accused Trump of lying about his business dealings is Russia and of directing hush payments to two women who have alleged affairs with Trump, including adult film star Stephanie Clifford, known professionally as Stormy Daniels.

Despite the apology, Gaetz remained critical of Cohen, retweeting an interview in which he suggested Cohen would lie to Congress about his work for Trump.

During Cohen’s testimony, Gaetz, who is not a member of the House Oversight Committee, could be seen talking with another Republican who was on the committee. Meanwhile, U.S. Rep. Stacey Plaskett, a Democrat representing the U.S. Virgin Islands, suggested during the hearing that the House Ethics Committee should investigate Gaetz and “possibly, him being referred for criminal prosecution.”

A former state representative from Okaloosa County, Gaetz has become one of Trump’s top Congressional allies since he moved from the Tallahassee statehouse to Washington, D.C. in 2017. He boasts that he often has the president’s ear, an audience he has earned through frequent Fox News appearances, where he’s a provocative defender of his party’s leader.

Gaetz is a social media maven and an instigator who has operated under the assumption that no publicity is bad publicity. “The organizing principle of today’s politics is ‘stay interesting,’ ” he once told GQ magazine.

That theory has been tested in the past 24 hours.