Administration officials said Mr. Trump was not trying to cause a rupture among Sunni Muslim nations in the Middle East. Rather, they said, he was expressing genuine frustration with Qatar’s record and making sure it followed through on the commitments it made in backing a new joint Terrorist Financing Targeting Center, which the president announced last month in Riyadh.

“The U.S. still wants to see this issue de-escalated and resolved immediately, keeping with the principles that the president laid out in terms of defeating terror financing,” said Sean Spicer, the White House press secretary.

Mr. Spicer denied that the president was taking sides. He said Mr. Trump had had a “very productive” discussion with Sheikh Tamim bin Hamad al-Thani, the 37-year-old emir of Qatar, during his visit to Riyadh. But another person briefed on the conversation said it had been noticeably colder than the president’s meetings with other gulf leaders.

In Washington, Qatar’s ambassador, Meshal bin Hamad al-Thani, expressed surprise at Mr. Trump’s tweets. “No one approached us directly and said, ‘Look, we have problems with this and this and this,’” he said in an interview with The Daily Beast.

There was little immediate threat to American military facilities in Qatar, administration officials and outside analysts said, not least because Qatar views America’s military presence as an insurance policy against the aggressive moves of its neighbors.

But the mood there was jittery. Government officials and news outlets described the cutoff of diplomatic relations, travel and trade as a “siege” and even as an attempt at a coup.

Those jitters have been intensified by suspicions that Russia was behind a cyberattack that published fake information on Qatar’s state news agency — a claim the United States is investigating, according to an official briefed on the inquiry, who spoke on the condition of anonymity. The official said it was unclear whether the hackers were state-sponsored.