A source familiar with Smith’s negotiations said the anchor informed Fox News well before the Barr meeting that he wanted to leave.

Smith has displayed his affection for Fox News in interviews and on-air. He was close to network founder Roger Ailes and paid a moving tribute to him after his death in May 2017, nearly a year after Ailes left amid widespread allegations of sexual harassment.

In his final broadcast on Friday, Smith recalled how he had been with Fox News since its inception, traveled the world, and “witnessed and reported on the events that shaped our reality.” In what could be seen as a veiled reference to Trump’s attacks, Smith said he aimed to “speak truth to power, without fear or favor, in context and with perspective.”

“Even in our currently polarized nation,” Smith said, “it’s my hope that the facts will win the day, that the truth will always matter, that journalism and journalists will thrive.”

It’s unclear precisely what prompted Smith’s decision, though sources said he was frustrated by the heightened tensions between the network’s news and opinion sides — some of which have played out publicly.

The network’s efforts to cover the House impeachment inquiry and other fallout from Trump’s urging Ukraine to investigate his Democratic rival Joe Biden have exposed divisions inside Fox News — and, at times, on-air. Smith and Tucker Carlson recently traded jabs after a guest on the latter’s show called senior judicial analyst Andrew Napolitano a “fool” in response to his view that Trump committed a crime.

Smith’s 3 p.m. show — which is part of Fox’s daily news coverage, not its evening opinion line-up — scrutinized and fact-checked Trump in a way that often contrasted sharply with the reflexive defense of the president by the opinion hosts and their guests.

On Thursday morning, Trump took aim at Smith and a few others at Fox News in claiming the network “doesn’t deliver for US anymore.” That night, at a rally in Minneapolis, Trump praised more than a half-dozen supportive Fox News and Fox Business hosts, such as Sean Hannity, Carlson, Laura Ingraham and Lou Dobbs.

Trump suggested to reporters on Friday that Smith’s departure was due to “terrible ratings.” (Actually, Smith averaged 1.3 million total viewers at 3 p.m. and topped his cable news competitors).

The shock inside Fox News after Smith announced his departure was reflected in the face of Neil Cavuto, who hosts the 4 p.m. hour. “Whoa,” Cavuto said as he began the broadcast. “Like you, I’m a little stunned and a little heartbroken.”

Network president Jay Wallace described Smith in a prepared statement as “one of the premier newscasters of his generation and his extraordinary body of work is among the finest journalism in the industry.”

“His integrity and outstanding reporting from the field helped put Fox News on the map, and there is simply no better breaking news anchor who has the ability to transport a viewer to a place of conflict, tragedy, despair or elation through his masterful delivery,” Wallace continued.

Smith quickly drew praise from colleagues and competitors on Twitter.

“He was part of the glue that held Fox together,” said Fox News correspondent John Roberts. “He is a supreme pro who made us all better.”

CNN’s Jake Tapper said it was “a bad day for those who respect and value factual, courageous reporting.”

Angelo Carusone, the president at Media Matters, a progressive watchdog that frequently criticized Fox News, suggested that Smith’s departure “should put to rest the myth that Fox has an actual news side.”

“Fox executives have made it clear that this is Sean Hannity’s network now,” Carusone added. “Be warned: Fox News is about to get even more deceitful and destructive.”

Smith said he “won’t be reporting elsewhere, at least in the near future,” under his agreement with Fox News.

The 3 p.m. slot will remain a news hour called “Fox News Reporting,” according to the network, with Jon Scott and Trace Gallagher among the anchors filling until a permanent host is selected.