WASHINGTON — He heard from his generals and his diplomats. Lawmakers weighed in and so did his advisers. But among the voices that rang powerfully for President Trump was that of one of his favorite Fox News hosts: Tucker Carlson.

While national security advisers were urging a military strike against Iran, Mr. Carlson in recent days had told Mr. Trump that responding to Tehran’s provocations with force was crazy. The hawks did not have the president’s best interests at heart, he said. And if Mr. Trump got into a war with Iran, he could kiss his chances of re-election goodbye.

However much weight that advice may or may not have had, the sentiments certainly reinforced the doubts that Mr. Trump himself harbored as he navigated his way through one of the most consequential foreign policy decisions of his presidency. By his own account, the president called off the “cocked & loaded” strike on Thursday night with only 10 minutes to spare to avoid the estimated deaths of as many as 150 people.

The concerns that Mr. Trump heard from Mr. Carlson reflected that part of the presidential id that has always hesitated at pulling the trigger. Belligerent and confrontational as he is in his public persona, Mr. Trump has at times pulled back from the use of force, convinced that America has wasted too many lives and too much money in pointless Middle East wars and wary of repeating what he considers the mistakes of his predecessors.