WASHINGTON — Rep. Matt Gaetz, R-Fla., apologized late Tuesday for a tweet that appeared to threaten to release unsavory allegations about President Trump's former fixer, Michael Cohen, as the onetime attorney prepared to testify publicly before Congress.

Gaetz was responding to a tweet from House Speaker Nancy Pelosi, D-California that said, "Comments made on social media or in the press can adversely affect the ability of House Committees to obtain the truthful and complete information."

"It was NOT my intent to threaten, as some believe I did," the congressman wrote on Twitter. "I’m deleting the tweet & I should have chosen words that better showed my intent. I’m sorry."

Earlier Tuesday Gaetz tweeted an ominous warning to Cohen:

"Hey @MichaelCohen212 - 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...," Gaetz said on Twitter Tuesday, without offering evidence.

A source close to Cohen swiftly responded, telling NBC News in a statement that "it is a shame Republicans have resorted to stooping this low and personally attacking Michael Cohen with lies about his personal life. These allegations are absolutely not true. The true story about President Trump's own lies and coverups will be told to the world tomorrow."

Lanny Davis, an attorney for Cohen, called Gaetz's tweet a "new low."

"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," he said in a statement.

Gaetz's tweet was criticized on social media as a blatant attempt to intimidate Cohen ahead of his public hearing.

"A tweet in which a sitting member of Congress tries his hand at witness intimidation," the former director of the Office of Government Ethics, Walter Shaub, said on Twitter.

Shaub also tweeted directly back at Gaetz with the relevant section of the U.S. Code that prohibits tampering with a witness, victim or an informant.

Gaetz, in an earlier interview Tuesday with NBC News on Capitol Hill, said that his "tweet speaks for itself."

"This isn't witness tampering. This is witness testing," he said.

“I don't threaten anybody. Michael Cohen threatens people ... Michael Cohen is a Ph.D. in threats and intimidation," he added.

Gaetz is not a member of the House Oversight Committee and will not question Cohen on Wednesday.

"I have regular conversations with my colleagues on the witnesses that come before our committees ... he’s a liar through and through," he said.

Gaetz, a staunch Trump ally, did not expand on whether he has any information regarding Cohen's personal relationships. Asked by NBC News how Gaetz knows Cohen has had extramarital affairs, the congressman's chief of staff, Jillian Lane Wyant, reiterated that his "tweet speaks for itself."

Cohen's highly-anticipated appearance before Congress comes after weeks of delays. His three-day stint on Capitol Hill began Tuesday with a closed-door session before the Senate Intelligence Committee. Only the Wednesday hearing before the House Oversight Committee is scheduled to be made public. Cohen will also testify before the House Intelligence Committee on Thursday.

A knowledgeable source about what to expect during Wednesday's hearing said Cohen will provide evidence of Trump's alleged criminal conduct since becoming president and detail his allegations of the president's lies, racism and cheating as a private businessman, NBC News previously reported.

Dartunorro Clark and Adam Reiss reported from New York, and Kailani Koenig reported from Washington.