Diplomatic spats in the Middle East are hardly rare. But the conflict that started this summer between Qatar and some of its Arab neighbors may be unique. It’s the first major geopolitical crisis to have been sparked by a computer hack, and was nearly the first “fake news” war to transform into a physical conflict. And far as anyone can tell, the fake news had a target audience of approximately one: US president Donald Trump.

In interviews and documentation provided to Quartz, the Qatari government has outlined its version of the events that led to the crisis in detail for the first time.

The world took notice of the conflict in June, when Bahrain, Saudi Arabia, and the United Arab Emirates (UAE) closed their borders with their tiny Gulf neighbor in response to comments attributed to the Qatari emir, Tamim bin Hamad al-Thani. They have since accused Doha of sponsoring terror groups and being too close to Iran. If the emir of Kuwait—who has been trying to end the dispute—is to be believed, they also contemplated a military intervention of some kind.

But it all started some two months earlier, the Qataris say, with a relatively mundane piece of cybercrime.

On April 19, a hacker gained access to the poorly-secured website of the state-run Qatar News Agency (QNA). The intruder had a Russian IP address (though that doesn’t prove the hack originated in Russia). About three days later the hacker discovered a vulnerability in the code of the news agency’s internal network and entered it. Within a few more days, the infiltrator had control over the entire network and had begun to collect email addresses, passwords and messages.

Weeks later, at 11:45pm on May 23, the hacker entered the news agency’s system and uploaded a news story filled with fabricated quotes attributed to Qatar’s emir, Tamim bin Hamad al-Thani. The story cited Tamim purportedly criticizing Trump and praising Iran—the US’s main strategic rival in the region—as an “Islamic power.” It also quoted him speaking warmly of Hamas, which the US has designated a terrorist organization, and its parent organization, the Muslim Brotherhood.

The fake story went live on the website at about 12:13am, and had soon become the most popular in the website’s history. Early the next morning Emirati and Saudi news sites were reporting the emir’s purported comments loudly and widely. QNA staff, in crisis mode, had shut the site down. Qatari officials had directly contacted their regional counterparts, asking them to prevent the story from spreading.

But the regional press had begun to publish a slew of negative stories about Qatar, accusing it of supporting terror groups and working against US interests, citing the QNA article as evidence. A small army of Twitter bots that had suddenly appeared (paywall) around the time of the first hack of the Qatar News site had also gone to work. By early June, the hashtag “قطع_العلاقات_مع_قطر#”—“Cut relations with Qatar”—was trending on Arabic-language Twitter. Qatar’s neighbours soon did exactly that.

It’s pretty clear what happened, Qatari officials say. Doha’s neighbors, Saudi Arabia and the UAE, had long been suspicious of their gas-rich neighbor. They disliked its independent and activist foreign policy and of its sponsorship of Al Jazeera, the popular and divisive news network based in Doha, which won international fame covering the Arab Spring uprisings of 2011 and has been critical of many Arab governments. The UAE in particular had grown increasingly frustrated with Qatar’s support for the Muslim Brotherhood, a transnational political Islamist group that Emirati officials see as a major threat to their internal stability and describe as a terrorist organization.

When Trump was elected president in November 2016, Abu Dhabi and Riyadh began aggressively courting the new leader of the free world and his inner circle. The Saudis and Emiratis predicted, correctly, that Trump, with his close dependence on family and trusted advisors, would not rely as much as previous presidents on the analysis of career diplomats and officials. They decided influence in Washington would be won by a mix of flattery, propaganda—heavily slanted towards Trump’s favorite social medium, Twitter—and, if the Qataris are to be believed, cybercrime.

Riyadh and Abu Dhabi deny these claims, and continue to argue that Qatar is a rogue state that needs to be brought to heel. They also deny reports that they considered invading Qatar. But Qatari officials say that their own investigations and two others conducted by the FBI’s cybercrimes unit and the UK’s National Crime Agency all point in one direction. (The FBI and the NCA both declined to comment for this story.)

In an account broadly substantiated to Quartz by two Western officials, the Washington Post reported in July (paywall) that US intelligence had evidence of a May 23 meeting between the UAE’s de facto leader, Mohammed bin Zayed, and his inner circle to approve the news site hack and a wider media campaign against Qatar.

Qatari officials, citing their own investigations and those carried out by the FBI and NCA, told Quartz the hacker behind the QNA breach had been in regular contact with someone in the UAE via Skype from April onwards. At about 11pm on May 23, shortly before the fake news story was posted, the QNA website had begun to see an unusual spike in traffic. Two IP addresses in the UAE accessed and refreshed the website’s home page dozens of times over the course of the next hour and a half.

“Qatar isn’t the US,” says a Qatari official. “There are only a certain number of people who access our state news site at midnight on a Tuesday. But we reached a peak of clicks that night. People were refreshing, waiting for [the story] to pop up.”

About 80% of the clicks came from the UAE, says the official, who showed Quartz supporting documentation of the server traffic. Most came from a single IP address, later traced back to a single mobile phone, again in the UAE. The phone, which had been refreshing the news agency’s home page repeatedly, was the first to access the article. The user would return to the article more than 40 times over the next half hour.

As far as Qatar’s rivals were concerned, the story on the QNA site was definitive proof of what they had been telling American officials for years, and Trump for months: that Qatar was a rogue state in cahoots with Iran and a supporter of terrorism. Initially at least, Trump seems to have taken the bait, going as far as to suggest the blockade was his idea. He has since urged the Gulf states to find a diplomatic solution to their problems, under pressure from White House officials.

If the Qatari account is true, it foreshadows a frightening new stage in cyber-conflict. In recent years, state-backed hackers have allegedly stolen Sony Pictures executives’ emails and released them to the public, hacked and released Democratic party emails, potentially changing the course (paywall) of the 2016 US election; and shut down power plants in Ukraine. Yet until now, no-one has tried to use the tools of cyber war to spark a physical one.

Technology is now emerging that can produce increasingly convincing digital mimicry of world leaders—just type in the words you want Obama, Trump, or the emir of Qatar to say, and they appear in a convincing-looking video. That would make fake news much more potent and harder to debunk.

If US officials are worried, they aren’t saying so publicly. “I haven’t seen a single American official condemn the actual attack itself,” says Andrew Bowen, a visiting fellow at the American Enterprise Institute, who believes the hack and subsequent media campaign were aimed at the president. “To basically cyber-hack another country and use it as a way to target the president of the United States, that is something I am surprised the White House has not commented on, frankly.”

What makes the Qatari episode truly worrying, therefore, is not that it nearly sparked another Middle Eastern war. The problem, says a senior Western diplomat, is that it shows fake news purveyors a new strategy: targeting not broad swathes of the population in an attempt to influence public opinion, but targeting one man, president Trump. “As long as he’s around this approach is going to remain attractive,” the diplomat says. “I somehow don’t think that he is going to wake up one day in the next three years and decide that he has become a New York Times rather than a Twitter reader.”