DOHA, Qatar — The report appeared just after midnight on the official Qatari news agency’s website, and its contents were stunning: The emir of Qatar was quoted as describing “tensions” with President Trump and speculating he may not last in office, recommending friendship with Iran, praising the Palestinian militants of Hamas, and then attesting to his own “good” relations with Israel.

The contradictory statements could hardly have been better contrived to alienate the United States and Arab countries around the Gulf, and Qatar immediately began to deny the report, early on May 24. But within 20 minutes, satellite networks controlled by Saudi Arabia and the United Arab Emirates had seized on the damning news flash and began interviewing long lines of well-prepared commentators to expound on the perfidy of Qatar.

The Qatari government said the news agency had been hacked, a claim now supported by the F.B.I. and British law enforcement officials. Though they would not say so publicly, Qatari officials blamed the Saudis and Emiratis.

Probably not coincidentally, a few days later, emails hacked from the Emirates’ ambassador to Washington began turning up in the Western news media and then the Qatari news network Al Jazeera.