(Corrects first paragraph to reflect Egypt not a Gulf state)
* Dawn phone call first sign of crisis
* Qatari Emir's speech allegedly hacked
* Saudis lose patience with their neighbour
By William Maclean and Stephen Kalin
DUBAI, June 7 (Reuters) - One of the first signs of the crisis in which three Gulf states and Egypt have cut ties with Qatar came in a phone call from an anxious government adviser to a Reuters journalist early on May 24.
In the 6.00 a.m. call, he denied Qatar's emir made comments reported by the state-run news agency criticising hostility to Iran, sympathising with three Islamist groups, accusing Saudi Arabia of adopting an extremist ideology that fosters terrorism and suggesting Donald Trump may not last long as U.S. president.
The adviser repeated a statement released hours earlier which said the news agency had been hacked, seeming unaware that Reuters had already reported the denial.
The unusual timing of the call and the adviser's haste to get the message across pointed to Qatar's deep concern about the impact the remarks attributed to the emir could have.
As anger mounted in Saudi Arabia and the United Arab Emirates, Qatar's foreign minister tried to limit the fallout.
Sheikh Mohammed bin Abdulrahman al-Thani told a news conference that Qatar, host to the biggest U.S. military base in the Middle East, wanted to maintain brotherly ties with its powerful neighbours in a region critical to world energy supplies.
To outside observers, it was unclear whether the Qatar News Agency had indeed been hacked or whether an editor had published remarks which the emir later regretted saying.
But to Qatar's neighbours the question was irrelevant: the comments reflected the broad lines of Qatar's independent-minded foreign policy, which critics say has destabilised the region through its alliance with Islamist armed groups and cordial ties with Iran.
Officials in the Gulf say the comments marked a turning point, prompting Saudi Arabia, Egypt, Bahrain and the United Arab Emirates to cut relations with Qatar in the biggest diplomatic shock in the region for years.
For Riyadh, trouble was also evident elsewhere.
Some Qatari-funded anti-Saudi websites had begun reporting on what they said were calls for protests against the kingdom's rulers, stirring memories of the Arab Spring revolutions that toppled the leaders of Egypt, Libya and Tunisia.
"They (Qataris) hired (financed) influential Saudi preachers, religious figures, journalists and academics to incite against Saudi Arabia," one Gulf source told Reuters. "The Saudis had had it with Qatar. The Qataris keep channels open with Iran in various capitals and they campaign against the Egyptian state."
The Saudis had reached a "dead end" with Qatar and decided for the first time in 20 years to take action to damage its neighbour's interests, the source added.
Qatar denies inciting unrest in Saudi Arabia or elsewhere.
Another factor that pushed the four Sunni states over the line, according to Gulf officials, was last month's visit to Saudi Arabia by Trump, who has reversed the policies of predecessor Barack Obama, thrown his weight behind the kingdom and its allies and expressed misgivings about Iran.
No sooner had Trump left Riyadh than the United States' partners in the region moved against Qatar and its young emir, Sheikh Tamim bin Hamad al-Thani, another American ally.
A series of flashpoints across the region in the days following Trump's visit heightened tensions that had been building for months and removed any hope among Qatar's neighbours of peeling it away from Iran and the Islamist groups it has engaged with for years.
Those tensions spilled into the public arena less than 48 hours after the Qatari emir took part in the Riyadh summit attended by Trump which was meant to showcase U.S. support for solidarity of Sunni Muslim nations.
The alleged hacking incident came days after Qatar complained it was the target of "an orchestrated barrage" of criticism by unknown parties, in the run-up to Trump's visit.
"After the Tamim speech, things went up an extra notch," a source familiar with the matter told Reuters.
"The catalogue is so wide... It is an accumulation," Anwar Gargash, UAE Minister of State for Foreign Affairs told Reuters. "It could have happened in March, it could have happened in December. But it was bound to happen. It was something that was ready to explode."
Gargash confirmed there were several major irritants that sped up the process. These included the comments attributed to the emir, UAE accusations that Qatar has undermined the Saudi-led coalition in Yemen, and Qatar's handling of a hostage crisis involving 24 members of the ruling elite in which it paid ransom money to Islamist groups in Iraq an Syria.
An annual phone call to mark the start of the holy Islamic month of Ramadan between Tamim and Iranian President Hassan Rouhani on May 27 aggravated the situation further. Iran's Shi'ite-led government and Saudi Arabia's Sunni rulers compete for influence in the region and Jean-Marc Rickli, a Geneva-based risk analyst, called that a "diplomatic mistake (which) Saudi Arabia and the UAE jumped on".
Kuwait's emir offered to mediate but when Tamim attended an iftar (fast-breaking) Ramadan meal with him on May 30, Tamim left early, apparently unwilling to discuss the row, a Kuwaiti newspaper editor regularly briefed by officials told Reuters.
The decision to cut ties with Qatar took shape in a rolling series of meetings over several weeks, said a Gulf Arab source.
But a second source said an important moment came last Saturday when Saudi King Salman and Sheikh Mohammed bin Zayed al-Nahyan, Crown Prince of Abu Dhabi, met for iftar in Jeddah. It is likely that Egypt came on board two days later, during a visit to Cairo by the Saudi foreign minister.
At dawn on Monday, those governments and Bahrain made a series of rapid fire announcements, revealing the move's careful orchestration and pre-planning.
A Western diplomat in Doha said the move was "clearly tied" to Trump's visit, suggesting it had emboldened Saudi Arabia and the UAE to act.
"The opportunity presented itself with the Trump visit and Trump's presidency in general," a former U.S. ambassador to Doha told Reuters, suggesting the move had been in the works for two or three months.
"This is well choreographed. Everything came together at the same time."
U.S. officials were blindsided by Saudi Arabia’s decision to sever ties with Qatar, current and former U.S. officials told Reuters.
A senior administration official said Washington had no indication at the Riyadh summit that the move was about to happen but on Tuesday morning Trump directly waded into the dispute by praising the Arab powers’ decisions against Qatar.
The Pentagon, mindful of the U.S. military base in Qatar, renewed its praise for Doha after Trump’s intervention -- showing again how U.S. officials are walking a tightrope as Trump’s tweets raise questions about existing policy and the scripted talking points used to explain it.
Reports that Qatari officials paid hundreds of millions of dollars to Iran-backed groups in an April deal to free 26 of its citizens kidnapped in Iraq last year has also been an irritant in relations between Saudi Arabia and the UAE.
Qatar denies trying to pay ransom money to secure the release of the hostages, although foreign minister al-Thani said it sent money "to support the authorities in the release of Qatari abductees".
Additional reporting by Samia Nakhoul, John Walcott, Sylvia Westall, Editing by Giles Elgood and Timothy Heritage