But the arrival — and extended stay — of the balloon over American territory prompted furious calls from senior U.S. officials to their Chinese counterparts, criticism from Republican lawmakers of the White House response, and on Friday, the cancellation of a visit to China by Secretary of State Antony J. Blinken. It would have been the first trip by a Biden Cabinet secretary to Beijing. In announcing the cancellation of his trip, Mr. Blinken said the entry of the spy balloon was a “clear violation of U.S. sovereignty and international law.”

U.S. officials conveyed to Chinese officials several times in recent days that the U.S. military might shoot down the spy balloon. Mr. Blinken told a Chinese diplomat in Washington on Wednesday evening that the American government had the right to take any actions to protect its interests, and he said the same thing on a phone call on Friday with Wang Yi, the top Chinese foreign policy official, a senior administration official said.

Evan Medeiros, a Georgetown University professor who was senior Asia director on President Barack Obama’s National Security Council, said the episode underscored the risks of accidents or miscalculation, as well as “the role of domestic politics in American debates about China — and the role of Congress in interpreting Chinese strategic intentions, including by constraining the administration’s options.”

Pentagon officials said the spy balloon, which was remotely maneuverable to some degree by the Chinese but still dependent on the jet stream for travel, began its controlled drift into American territory on Jan. 28, when it entered Alaskan airspace near the Aleutian Islands. It first appeared to trackers at United States Northern Command to be just another one of China’s probes around the edges of America’s defensive borders.

A senior administration official said that China had developed a fleet of balloons to conduct surveillance operations that have been spotted over countries across five continents. They typically orbit at about 60,000 feet, and have occasionally strayed into American territory. Earlier, a senior defense official said that had happened three times during the Trump administration and one previous time during the Biden administration.

Officials said the most recent balloon, equipped with solar panels to power propulsion and cameras and surveillance technology, exited American territory on Monday and spent the day over Canada’s Northwest Territories. But it was back over the United States on Tuesday after entering through northern Idaho, much to the surprise of officials at Northern Command as well as at the Pentagon.

Gen. Mark A. Milley, the chairman of the Joint Chiefs of Staff, alerted Mr. Biden.

By Wednesday, when the balloon had made its way to the skies above Billings, Mont., Pentagon officials were alarmed because the state is home to the 341st Missile Wing at Malmstrom Air Force Base, one of three U.S. Air Force bases that operate and maintain intercontinental ballistic missiles. One Pentagon official described shock at what officials viewed as a blatant, and poorly concealed, effort at spying. A senior Biden administration official called the move audacious.