Shepard Smith, one of the longest-tenured journalists at Fox News who was also considered a moderate voice on the right-leaning cable news giant, announced Friday that he's resigned from the company.

Smith, who has been at the network for more than two decades and was one of its original hires, said the decision to leave was his own.

“Recently, I asked the company to allow me to leave Fox News. After requesting that I stay, they obliged,” he said on air.

Download the NBC News app for breaking news

Later, in a statement released by Fox News, Smith thanked the network for allowing a "guy from small-town Mississippi" to have a seat at one of America's most powerful anchor chairs.

"It’s been an honor and a privilege to report the news each day to our loyal audience in context and with perspective, without fear or favor," he said in the statement. "I’ve worked with the most talented, dedicated and focused professionals I know and I’m proud to have anchored their work each day — I will deeply miss them.”

The departure comes as Fox News has been the focus of increased scrutiny for its close relationship with President Donald Trump particularly as impeachment efforts have escalated. The cable channel's opinion personalities have broadly defended Trump.

That led to some conflict with news anchors, most notably Smith and Chris Wallace, who have pushed back against false assertions from the president and his supporters.

A source familiar with the company who was not authorized to speak publicly said that a recent public conflict with Tucker Carlson, one of Fox's primetime opinion hosts, helped lead to Smith's exit.

The source also said that the absence of Roger Ailes, the Republican media consultant considered the architect of Fox News who passed away in May 2017, has created problems.

Ailes' departure led to a power vacuum at the company, with new CEO Suzanne Scott unable to exert the kind of control over the channel's big-name talent that Ailes did. "Roger knew how to herd the cats," the source said. "The whole environment is careening out of control.”

The network and Smith announced in March 2018 that they had agreed to a new multi-year deal — though specifics of the reported pact were not revealed.

Friday's announcement stunned even some of Smith's closest colleagues.

"Shepard Smith just dropped a bomb," FNC's chief White House correspondent John Roberts tweeted. "After 23 years at @FoxNews, he announced he is leaving the network. He was part of the glue that held Fox together. He is a supreme pro who made us all better."

Fox News host Neil Cavuto, whose show started shortly after Smith's statement, appeared to have been caught off-guard by the news.

.@ShepNewsTeam Shepard Smith just dropped a bomb. After 23 years at @FoxNews , he announced he is leaving the network. He was part of the glue that held Fox together. He is a supreme pro who made us all better. — John Roberts (@johnrobertsFox) October 11, 2019

"Like you, I'm a little stunned and a little heartbroken," Cavuto told viewers. "I don't know what to say."

He called Smith "a decent human being" with "a heart as big as Texas."

"A better newsman you probably cannot find," Cavuto added. "So, Shepard, I don't know what the heck you're planning to do or where you go, but I just know you'll be great at doing it and you deserve the best that life has to offer. So I'm sorry if I'm a little shell-shocked here, but I'm going to miss my buddy."

Angelo Carusone, president of liberal media watchdog group Media Matters for America, said Smith was one of the few voices that helped FNC keep a modicum of straight news credibility.

"Fox News has routinely held up Shep Smith as cover to suggest that the network has a straight news side. Smith abruptly quitting Fox News should put to rest the myth that Fox News has an actual news side," Carusone said.

Smith has been a critic of Trump, most recently ripping him for insisting, incorrectly, that Alabama was a target of Hurricane Dorian.

"Everybody makes mistakes,” Smith said on air at the time. “Instead ... the president blamed the media for his own inaccurate warning and then started to rewrite history on the matter.”

Trump appeared to doctor a map to make his point in an Oval Office address.

“Why would the president of the United States do this?" Smith said. "He decries fake news that isn’t, and disseminates fake news that is.”

Trump has often criticized Smith, including a tweet Thursday in which the president said Fox News is "much different than it used to be in the good old days."

...Court Justice & I turned him down (he’s been terrible ever since), Shep Smith, @donnabrazile (who gave Crooked Hillary the debate questions & got fired from @CNN), & others, @FoxNews doesn’t deliver for US anymore. It is so different than it used to be. Oh well, I’m President! — Donald J. Trump (@realDonaldTrump) October 10, 2019

When asked if his administration had pressured Fox News to part ways with Smith, Trump told reporters on the White House South Lawn before departing for a rally in Louisiana that he was unaware of Smith's departure.

"Did I hear Shepard Smith is leaving? Is he leaving because of bad ratings?" Trump said. "I wish Shepard Smith well."

One journalist asked why Attorney General William Barr met Wednesday with Rupert Murdoch, chairman of Fox News' parent company, Fox Corp., a meeting reported by The New York Times. Trump did not address the question.

Smith joined Fox News in 1996 when the channel was first started by News Corp, the media company then run by Murdoch. Though Smith was seen as a moderate voice, he also drew a hard line between his news show and Fox's conservative talkers.

"Everybody's got a job to do. Hannity is trying to get conservatives elected. And he wants you to listen to him and believe what he believes," Smith said in a 2016 interview with HuffPost. "And I'm disseminating facts. It's really apples and teaspoons. What we do is so different. He's an entertaining guy who has an audience that he serves, and I deliver the news."

And back in 2009, Smith took on Republican orthodoxy by forcefully saying American intelligence officers should not use torture in interrogating detainees.

"We are America. I don't give a rat's ass if it helps," he angrily said on FNC's digital show "The Strategy Room." "We are America. We do not f---ing torture. We don't do it."