A range of senior advisers dissuaded the president from moving ahead with a military strike. The advisers — including Vice President Mike Pence; Secretary of State Mike Pompeo; Christopher C. Miller, the acting defense secretary; and Gen. Mark A. Milley, the chairman of the Joint Chiefs of Staff — warned that a strike against Iran’s facilities could easily escalate into a broader conflict in the last weeks of Mr. Trump’s presidency.

Any strike — whether by missile or cyber — would almost certainly be focused on Natanz, where the International Atomic Energy Agency reported on Wednesday that Iran’s uranium stockpile was now 12 times larger than permitted under the nuclear accord that Mr. Trump abandoned in 2018. The agency also noted that Iran had not allowed it access to another suspected site where there was evidence of past nuclear activity.

Mr. Trump asked his top national security aides what options were available and how to respond, officials said.

After Mr. Pompeo and General Milley described the potential risks of military escalation, officials left the meeting believing a missile attack inside Iran was off the table, according to administration officials with knowledge of the meeting.