WASHINGTON — President Trump approved military strikes against Iran in retaliation for downing an American surveillance drone, but pulled back from launching them on Thursday night after a day of escalating tensions.

As late as 7 p.m., military and diplomatic officials were expecting a strike, after intense discussions and debate at the White House among the president’s top national security officials and congressional leaders, according to multiple senior administration officials involved in or briefed on the deliberations.

Officials said the president had initially approved attacks on a handful of Iranian targets, like radar and missile batteries.

The operation was underway in its early stages when it was called off, a senior administration official said. Planes were in the air and ships were in position, but no missiles had been fired when word came to stand down, the official said.

The abrupt reversal put a halt to what would have been the president’s third military action against targets in the Middle East. Mr. Trump had struck twice at targets in Syria, in 2017 and 2018.

It was not clear whether Mr. Trump simply changed his mind on the strikes or whether the administration altered course because of logistics or strategy. It was also not clear whether the attacks might still go forward.

Asked about the plans for a strike and the decision to hold back, the White House declined to comment, as did Pentagon officials. No government officials asked The New York Times to withhold the article.

The retaliation plan was intended as a response to the shooting down of the unmanned, $130 million surveillance drone, which was struck Thursday morning by an Iranian surface-to-air missile, according to a senior administration official who was briefed on the military planning and spoke on the condition of anonymity to discuss confidential plans.

The strike was set to take place just before dawn Friday in Iran to minimize risk to the Iranian military and civilians.

But military officials received word a short time later that the strike was off, at least temporarily.

The possibility of a retaliatory strike hung over Washington for much of the day. Officials in both countries traded accusations about the location of the drone when it was destroyed by a surface-to-air missile launched from the Iranian coast along the Gulf of Oman.

Mr. Trump’s national security advisers split about whether to respond militarily. Senior administration officials said Secretary of State Mike Pompeo; John R. Bolton, the national security adviser; and Gina Haspel, the C.I.A. director, had favored a military response. But top Pentagon officials cautioned that such an action could result in a spiraling escalation with risks for American forces in the region.

Congressional leaders were briefed by administration officials in the Situation Room.

The destruction of the drone underscored the already tense relations between the two countries after Mr. Trump’s recent accusations that Iran is to blame for explosions last week that damaged oil tankers traveling through the strait, the vital waterway for much of the world’s oil. Iran has denied that accusation.

Iran’s announcement this week that it would soon breach one of the key limits it had agreed to in a 2015 pact intended to limit its nuclear program has also fueled tensions. Mr. Trump, who pulled the United States out of the 2015 pact, has vowed that he will not allow Tehran to build a nuclear weapon.

On Thursday, Mr. Trump insisted that the United States’ unmanned surveillance aircraft was flying over international waters when it was taken down by an Iranian missile.

“This drone was in international waters, clearly,” the president told reporters on Thursday afternoon at the White House as he began a meeting with Prime Minister Justin Trudeau of Canada. “We have it all documented. It’s documented scientifically, not just words.”

Asked what would come next, Mr. Trump said, “Let’s see what happens.”

Iran’s government fiercely disputed the president’s characterization, insisting that the American drone had strayed into Iranian airspace. Iran released GPS coordinates that put the drone eight miles off the country’s coast, inside the 12 nautical miles from the shore that Iran claims as its territorial waters.

Majid Takht-Ravanchi, Iran’s ambassador to the United Nations, wrote in a letter to the Security Council that the drone ignored repeated radio warnings before it was downed. He said that Tehran “does not seek war” but “is determined to vigorously defend its land, sea and air.”

Congressional Democrats emerged from the president’s classified briefing in the Situation Room and urged Mr. Trump to de-escalate the situation. They called on the president to seek congressional authorization before taking any military action.

“This is a dangerous situation,” Speaker Nancy Pelosi said. “We are dealing with a country that is a bad actor in the region. We have no illusions about Iran in terms of their ballistic missile transfers, about who they support in the region and the rest.”

Iran’s destruction of the drone appeared to provide a boost for officials inside the Trump administration who have long argued for a more confrontational approach to Iran, including the possibility of military actions that could punish the regime for its support of terrorism and other destabilizing behavior in the region.

But in his public appearance, Mr. Trump initially seemed to be looking for a way to avoid a potentially serious military crisis. Instead of directly accusing the leaders of Iran, Mr. Trump said someone “loose and stupid” in Iran was responsible for shooting down the drone.

The president said he suspected it was some individual in Iran who “made a big mistake,” even as Iran had taken responsibility for the strike and asserted that the high-altitude American drone was operating over Iranian air space, which American officials denied.

Mr. Trump said the episode would have been far more serious if the aircraft had been a piloted vehicle, and not a drone. It made “a big, big difference” that an American pilot was not threatened, he told reporters.

Last year, Mr. Trump pulled the United States out of the 2015 nuclear pact with Iran, over the objections of China, Russia and American allies in Europe. He has also imposed punishing economic sanctions on Iran, trying to cut off its already limited access to international trade, including oil sales.

Iran has warned of serious consequences if Europe does not find a way around those sanctions, though it has denied involvement in the attacks on tankers near the vital Strait of Hormuz. On Monday, Iran said it would soon stop abiding by a central component of the nuclear deal, the limit on how much enriched uranium it is allowed to stockpile.

Both Washington and Tehran said the downing of the drone occurred at 4:05 a.m. Thursday in Iran, or 7:35 p.m. Wednesday in Washington. The drone “was shot down by an Iranian surface-to-air missile system while operating in international airspace over the Strait of Hormuz,” the United States Central Command said in a statement. “This was an unprovoked attack on a U.S. surveillance asset in international airspace.”

Iran’s ability to target and destroy the high-altitude American drone, which was developed to evade the very surface-to-air missiles used to bring it down, surprised some Defense Department officials, who interpreted it as a show of how difficult Tehran can make things for the United States as it deploys more troops and steps up surveillance in the region.

Lt. Gen. Joseph Guastella, the Air Force commander for the Central Command region in the Middle East, said the attack could have endangered “innocent civilians,” even though officials at Central Command continued to assert that the drone was over international waters. He said that the closest that the drone got to the Iranian coast was 21 miles.

Late Thursday, the Defense Department released additional imagery in an email to support its case that the drone never entered Iranian airspace. But the department incorrectly called the flight path of the drone the location of the shooting down and offered little context for an image that appeared to be the drone exploding in midair.

It was the latest attempt by the Pentagon to try to prove that Iran has been the aggressor in a series of international incidents.

Iran’s foreign affairs minister, Mohammad Javad Zarif, said in a post on Twitter that he gave what he said were precise coordinates for where the American drone was targeted.

“At 00:14 US drone took off from UAE in stealth mode & violated Iranian airspace,” he said in a tweet that included coordinates that he said were near Kouh-e Mobarak. “We’ve retrieved sections of the US military drone in OUR territorial waters where it was shot down.”

Mr. Trump’s comments on Thursday afternoon in the Oval Office reflected the longstanding tension between the president’s desire to be seen as tough on the world stage and his campaign promise to make sure that the United States did not get tangled in more foreign wars.

The president has embraced a reputation as someone who punches back when he is challenged. Only months into his tenure, Mr. Trump launched 59 Tomahawk cruise missiles at an air base in Syria after a chemical weapon attack.

But he has often talked about ending American involvement in long-running conflicts abroad, describing his “America First” agenda as having little room for being the world’s police force. In a tweet in January, he said he hoped that “Endless Wars, especially those which are fought out of judgement mistakes” would “eventually come to a glorious end!”

According to Iranian news media, a foreign minister spokesman there said that flying a drone into Iranian airspace was an “aggressive and provocative” move by the United States.

“We are not going to get engaged in a war with any country, but we are fully prepared for war,” Mr. Salami said at a military ceremony in Sanandaj, Iran, according to a translation from Press TV, a state-run news outlet. “Today’s incident was a clear sign of this precise message, so we are continuing our resistance.”

Iranian news media said the drone had flown over Iranian territory unauthorized, and reported that it had been shot down in the Hormozgan Province, along the country’s southern coast on the Persian Gulf and the Gulf of Oman.

Both the United States and Iran identified the aircraft as an RQ-4 Global Hawk, a surveillance drone made by Northrop Grumman.

“This was a show of force — their equivalent of an inside pitch,” said Derek Chollet, a former assistant secretary of defense for international security affairs during the Obama administration, speaking of Iran’s decision to shoot down the drone.

James G. Stavridis, who retired as a four-star admiral after serving as the supreme allied commander at the North Atlantic Treaty Organization, warned that the two countries were in a dangerous game that could quickly spiral out of control. He described Iran’s downing of the drone, which costs about $130 million, as a “logical albeit highly dangerous escalatory move by Iran.”

Trump says that he called off the airstrike because it would've resulted in around 150 casualties, and that response wasn't proportionate to shooting down of an unmanned drone. I can't say I disagree with him.

When you care about how many of your enemy will die you're not at all prepared for war. The appropriate question is how many can we kill today? The United States of America has no stomach for war which is why we lose in the end.