Former Rep. Trey Gowdy was fired as a Fox News contributor, a spokesperson for the network told CNBC on Wednesday, as he joins President Donald Trump's outside counsel amid an impeachment inquiry into the president.

The spokesperson said Gowdy "has been terminated and is no longer a contributor" to Fox, where the South Carolina Republican had appeared just days before to discuss the ongoing impeachment inquiry in the House.

A source familiar with the situation noted that Gowdy representing the president would pose a conflict of interest with his role as a Fox contributor. Gowdy's agent waited to confirm the job change, the source told CNBC, which is why Fox revealed that he is no longer a contributor prior to an official announcement about his new role as Trump's counsel.

Multiple outlets, including Fox, reported this week that Gowdy was hired to serve as outside counsel to Trump.

"I am pleased to announce that former Congressman Trey Gowdy is joining our team as Counsel to the President," Trump's personal lawyer Jay Sekulow told NBC News. "I have known Trey for years and worked with him when he served in Congress. His legal skills and his advocacy will serve the president well. Trey's command of the law is well known and his service on Capitol Hill will be a great asset as a member of our team."

As Trump reportedly beefs up his outside legal team, White House counsel Pat Cipollone sent a shot across the bow to Democrats leading the impeachment inquiry, declaring in a defiant letter that the Trump administration will not cooperate with the congressional probe.

The impeachment inquiry centers around Trump's July 25 call with Ukraine President Volodymyr Zelensky, in which the U.S. president asked for Ukraine to "look into" unsubstantiated corruption allegations against former Vice President Joe Biden — Trump's possible 2020 rival — and his son Hunter. Trump also asked Zelensky to "do us a favor though" and investigate Ukraine's connection to former special counsel Robert Mueller's Russia probe.

Gowdy, 55, had served as the chairman of the House Oversight and Government Reform Committee and the head of the House Benghazi Committee, which investigated a terrorist attack in Libya that left four Americans dead, including the country's U.S. ambassador, Christopher Stevens.

Gowdy did not seek reelection in the 2018 midterms, where Democrats took majority control of the House. He joined law firm Nelson Mullins Riley & Scarborough, and had been a Fox contributor since January.

In a recent appearance on Fox, Gowdy had blasted House Intelligence Chairman Adam Schiff, D-Calif., who is a leader in the impeachment inquiry — and a prime target of Trump, who has repeatedly accused the committee chief of "treason."

"Bias kills investigations, and for anyone who wondered whether Adam Schiff could be objective or dispassionate — I never wondered that, but if any of your viewers did — now you know, he makes up facts in openings and he lies about meetings with whistleblowers," Gowdy said.

Gowdy was referring to The Washington Post's fact-check of Schiff's Sept. 17 claim that "We have not spoken directly with the whistleblower" — which the newspaper rated false — and the chairman's self-described parody of Trump's call with Zelensky that used mobster-like language.

Republicans have accused Schiff of fabricating Trump's remarks in that call, even though Schiff said before his comments that he was characterizing "the essence of what the president communicates." Schiff also concluded the parody by saying: "This is, in sum and character, what the president was trying to communicate."