The United Arab Emirates orchestrated the hacking of Qatari government news and social media sites in order to post incendiary false quotes attributed to Qatar’s emir, Sheikh Tamim Bin Hamad al-Thani, in late May that sparked the ongoing upheaval between Qatar and its neighbors, according to U.S. intelligence officials.

Officials became aware last week that newly analyzed information gathered by U.S. intelligence agencies confirmed that on May 23, senior members of the UAE government discussed the plan and its implementation. The officials said it remains unclear whether the UAE carried out the hacks itself or contracted to have them done. The false reports said that the emir, among other things, had called Iran an “Islamic power” and praised Hamas.

The hacks and posting took place on May 24, shortly after President Trump completed a lengthy counterterrorism meeting with Persian Gulf leaders in neighboring Saudi Arabia and declared them unified.

Citing the emir’s reported comments, the Saudis, the UAE, Bahrain and Egypt immediately banned all Qatari media. They then broke relations with Qatar and declared a trade and diplomatic boycott, sending the region into a political and diplomatic tailspin that Secretary of State Rex Tillerson has warned could undermine U.S. counterterrorism efforts against the Islamic State.

[Tillerson heads home from Qatar with no resolution of regional dispute]

(The Washington Post)

In a statement released in Washington by its ambassador, Yousef al-Otaiba, the UAE said the Post article was “false.”

“The UAE had no role whatsoever in the alleged hacking described in the article,” the statement said. “What is true is Qatar’s behavior. Funding, supporting, and enabling extremists from the Taliban to Hamas and Qadafi. Inciting violence, encouraging radicalization, and undermining the stability of its neighbors.”

The revelations come as emails purportedly hacked from Otaiba’s private account have circulated to journalists over the past several months. That hack has been claimed by an apparently pro-

Qatari organization calling itself GlobalLeaks. Many of the emails highlight the UAE’s determination over the years to rally Washington thinkers and policymakers to its side on the issues at the center of its dispute with Qatar.

All of the Persian Gulf nations are members of the U.S.-led coalition against the Islamic State. More than 10,000 U.S. troops are based at Qatar’s al-Udeid Air Base, the U.S. Central Command’s regional headquarters, and Bahrain is the home of the U.S. Navy’s 5th Fleet. All are purchasers of U.S. defense equipment and tied to U.S. foreign policy priorities in numerous ways.

The conflict has also exposed sharp differences between Trump — who has clearly taken the Saudi and UAE side in a series of tweets and statements — and Tillerson, who has urged compromise and spent most of last week in shuttle diplomacy among the regional capitals that has been unsuccessful so far.

“We don’t expect any near-term resolution,” Tillerson aide R.C. Hammond said Saturday. He said the secretary had left behind proposals with the “Saudi bloc” and with Qatar including “a common set of principles that all countries can agree to so that we start from . . . a common place.”

Qatar has repeatedly charged that its sites were hacked, but it has not released the results of its investigation. Intelligence officials said their working theory since the Qatar hacks has been that Saudi Arabia, the UAE, Egypt or some combination of those countries were involved. It remains unclear whether the others also participated in the plan.

U.S. intelligence and other officials spoke on the condition of anonymity to discuss the sensitive matter.

The Office of the Director of National Intelligence declined to comment, as did the CIA. The FBI, which Qatar has said was helping in its investigation, also declined to comment.

A spokesman for the Qatari Embassy in Washington responded by drawing attention to a statement by that government’s attorney general, Ali Bin Fetais al-Marri, who said late last month that “Qatar has evidence that certain iPhones originating from countries laying siege to Qatar were used in the hack.”

Hammond said he did not know of the newly analyzed U.S. intelligence on the UAE or whether Tillerson was aware of it.

The hacking incident reopened a bitter feud among the gulf monarchies that has simmered for years. It last erupted in 2013, when Saudi Arabia, the UAE and Bahrain accused Qatar of providing safe haven for their political dissidents and supporting the pan-Arab Muslim Brotherhood; funding terrorists, including U.S.-designated terrorist groups such as Hamas and Hezbollah; and using its state-funded media outlets to destabilize its neighbors.

[Key senator threatens arms sales over gulf dispute]

Qatar — an energy-rich country ruled by its own unelected monarchy — saw the Saudi-led accusations as an attempt by neighboring autocrats to stifle its more liberal tendencies. Separately, the United States warned Qatar to keep a tighter rein on wealthy individuals there who surreptitiously funded Islamist terror groups — a charge that Washington has also made in the past against the Saudis and other gulf countries. While Qatar promised some steps in response to the charges in a 2014 agreement with the others, it took little action.

During his two-day visit to ­Riyadh, Trump met with the six-member Gulf Cooperation Council — Saudi Arabia, the UAE, Kuwait, Bahrain, Oman and Qatar — and held individual closed-door meetings with several GCC leaders, including the Qatar emir. The day before his departure on the morning of May 22, Trump delivered a speech, focused on the need for religious tolerance and unity against terrorism, to more than 50 Muslim leaders gathered from around the world for the occasion.

But he devoted most of his attention to Saudi King Salman, praising as a wise leader the man who controls his country’s vast oil reserves. In what the administration hailed as a high point of the visit, the Saudis agreed to purchase $110 billion in U.S. arms and signed letters of intent to invest hundreds of billions in deals with U.S. companies.

He had told the Saudis in advance, Trump said in an interview Wednesday with the Christian Broadcasting Network, that the agreements and purchases were a prerequisite for his presence. “I said, you have to do that, otherwise I’m not going,” Trump recounted.

The statements attributed to the emir first appeared on the Qatar News Agency’s website early on the morning of May 24, in a report on his appearance at a military ceremony, as Trump was wrapping up the next stop on his nine-day overseas trip, in Israel. According to the Qatari government, alerts were sent out within 45 minutes saying the information was false.

Later that morning, the same false information appeared on a ticker at the bottom of a video of the emir’s appearance that was posted on Qatar News Agency’s YouTube channel. Similar material appeared on government Twitter feeds.

The reports were repeatedly broadcast on Saudi Arabian government outlets, continuing even after the Qatari alert said it was false. The UAE shut down all broadcasts of Qatari media inside its borders, including the Qatari-funded Al Jazeera satellite network, the most watched in the Arab world.

[Why Saudi Arabia hates Al Jazeera so much]

The first week in June, the ­Saudi-led countries severed relations, ordered all Qatari nationals inside their countries to leave, and closed their borders to all land, air and sea traffic with Qatar, a peninsular nation in the Persian Gulf whose only land connection is with Saudi Arabia.

In addition to charges of supporting terrorism and promoting instability inside their countries, they accused Qatar of being too close to Iran, Saudi Arabia’s main rival for regional power and, according to the United States, the world’s foremost supporter of global terrorism. Iran conducts robust trade with most of the gulf, including the UAE, and shares the world’s largest natural gas field with Qatar.

The day after the boycott was announced, Trump indirectly took credit for it. “So good to see the Saudi Arabia visit with King and 50 countries already paying off,” he tweeted. “They said they would take a hard line on funding extremism, and all reference was pointing to Qatar.”

At the same time, Tillerson and Defense Secretary Jim Mattis called for negotiations and a quick resolution of the dispute. When the Saudi-led group released a list of 13 “non-negotiable” demands for Qatar — including shutting down Al Jazeera and expelling a number of people deemed terrorists — the State Department suggested that they were unreasonable and that the terrorism funding issue was a smokescreen for long-standing regional grievances that should be resolved through mediation and negotiation.

Qatar rejected the demands. Tillerson appeared to agree that they were draconian. But when he called for the boycott to be eased, saying it was causing both security and humanitarian hardship, Trump said the measure was harsh “but necessary.”

The one concrete result of Tillerson’s stops in the region last week was a new bilateral agreement signed with Qatar on stopping terrorism financing, the only one of the gulf countries that had responded to an invitation to do so, Hammond said.

Speaking to reporters on his plane flying back to Washington on Friday, Tillerson said the trip was useful “first to listen and get a sense of how serious the situation is, how emotional some of these issues are.” He said that he had left proposals with both sides that suggested “some ways that we might move this forward.”

All of the countries involved, Tillerson said, are “really important to us from a national security standpoint. . . . We need this part of the world to be stable, and this particular conflict between these parties is obviously not helpful.”

Asked about Trump’s tweets and other comments, he noted that being secretary of state “is a lot different than being CEO of Exxon,” his previous job, “because I was the ultimate decision-maker.” He knew what to expect from long-standing colleagues, he said, and decision-making was disciplined and “highly structured.”

“Those are not the characteristics of the United States government. And I don’t say that as a criticism, it’s just an observation of fact,” Tillerson said. While neither he nor the president came from the political world, he said, his old job put him in contact with the rest of the world and “that engagement . . . is actually very easy for me.”

For his part, Trump agreed in the Christian Broadcasting Network interview that he and Tillerson “had a little bit of a difference, only in terms of tone” over the gulf conflict.

Qatar, Trump said, “is now a little bit on the outs, but I think they’re being brought back in.” Asked about the U.S. military base in Qatar, Trump said he was not concerned.

“We’ll be all right,” he said. “Look, if we ever have to leave” the base, “we would have 10 countries willing to build us another one, believe me. And they’ll pay for it.”

Kareem Fahim in Istanbul and

Carol Morello in Washington contributed to this report.