His pointed comments, closer in tone to that of CNN anchors like Anderson Cooper than of Fox News mainstays like Sean Hannity and Tucker Carlson, irked Mr. Trump, who had taken to taunting Mr. Smith on Twitter as the network’s “lowest-rated anchor.” Other Fox News personalities were also unimpressed: Last month, Mr. Carlson openly mocked Mr. Smith on-air, a rare moment of intramural discord bursting into public view.

[Read about on-air sniping at Fox News.]

The internal tensions had frustrated Mr. Smith, 55, who was dismayed at the disconnect between some of the pro-Trump cheerleading in prime-time and the reporting produced by the network’s newsroom, according to two people close to the anchor who requested anonymity to share his private observations. Mr. Smith had been considering an exit from Fox News for several weeks, the people said.

On Friday, in public at least, all parties played down any difficulties.

“I’ve worked with the most talented, dedicated and focused professionals I’ve ever known,” Mr. Smith said on his farewell newscast. “I’ll miss them and our time together greatly.”

In a farewell statement, Jay Wallace, the network’s president and executive editor, called the anchor’s exit “especially difficult.”

Mr. Smith was familiar to viewers for his authoritative but genial Mississippi lilt. But one hint at the strain on Mr. Smith was his decision to leave in the middle of his multiyear contract, which he signed in 2018. Exiting partway through a deal is a rarity in the cutthroat television business and the move is likely to cost him millions of dollars. Mr. Smith also agreed to abide by a noncompete clause, telling viewers, “I won’t be reporting elsewhere, at least in the near future.”