Egyptian President Abdel Fattah al-Sissi, Saudi King Salman, and President Donald Trump at the Global Center for Combating Extremist Ideology, in Riyadh. Saudi Press Agency

In early June, several Arab countries, led by Saudi Arabia, cut diplomatic ties with neighboring Qatar over its alleged funding of terrorist groups and intention of "destabilizing the region."

The split has inflamed the region at a time when US officials thought the states involved had united in a common front against Iranian influence.

While US Secretary of State Rex Tillerson and Defense Secretary James Mattis have scrambled to sooth the crisis and bring all sides back together, the split has been exacerbated by their boss, President Donald Trump, who has on two occasions condemned and mocked Qatar, a longtime US partner.

Saudi Arabia and its partners broke off ties with Doha in early June, days after Trump left a summit attended by dozens of leaders from the region. Speaking after his return to the US, Trump said, "Nations came together and spoke to me about confronting Qatar over its behaviors" during his trip abroad.

"I decided, along with Secretary of State Rex Tillerson, our great generals and military people, the time had come to call on Qatar to end its funding. They have to end that funding and its extremist ideology," the president added. "The nation of Qatar has historically been a funder of terrorism at a very high level."

Saudi Arabia's King Salman bin Abdulaziz Al Saud receives President Donald Trump for the Arab Islamic American Summit in Riyadh, May 21, 2017. REUTERS/Jonathan Ernst

Trump's comments came hours after and contradicted a statement from Tillerson that called on the Saudi-led bloc to drop its blockade of Qatar — home to a massive US military base — and announced US support for a mediation effort led by Kuwait.

Tillerson was not only "blind-sided by the Trump statement," but also "absolutely enraged that the White House and State Department weren’t on the same page," one of the secretary's close associates told analyst and author Mark Perry.

The differing statements exposed the gulf between Tillerson's and Trump's positions, and, in Tillerson's eyes, confirmed that Trump was running a second foreign policy out of the White House, relying on the counsel of senior adviser Jared Kushner.

Tillerson has lashed out at the White House over his department's chronic personnel shortage, though he has also cut staff.

Israeli Prime Minister Benjamin Netanyahu and President Donald Trump with White House senior adviser Jared Kushner, during a meeting in Jerusalem, May 22, 2017. Thomson Reuters

The isolation of Qatar and breakdown of the anti-Iran front likely also frustrated Mattis, who places Tehran among the US's most significant geopolitical rivals.

Mattis has also worked to preserve ties to Doha by signing off on arms deals, even as Trump bashes Qatar. (The US also completed naval drills with Qatar in early June.)

The crisis remained unresolved throughout June, with the Saudi-led bloc issuing 13 demands for Doha to comply with to lift the blockade, expanding the scope of the dispute beyond the initial emphasis on terrorism financing.

Among them were the requirement to cut diplomatic ties with Iran and sever links to terrorist organizations — like the Muslim Brotherhood, which Tillerson has cautioned against classifying as a terrorist group — as well as shutting down news outlets funded by Qatar, like Al Jazeera, and ending the Turkish military presence in Qatar.

Doha has shown some accommodation of the demands and has said it's ready to discuss "legitimate issues" with other Arab states. But Qatar also said some of the demands were impossible to meet because they're not true. The deadline for compliance is Sunday.

As leaders from the region descend on Washington this week, angling for time with Tillerson, the crisis has shown no sign of receding, and, at a fundraiser on Wednesday, Trump lauded Saudi Arabia and again bashed Qatar.

"Last month, I had a historic summit with 54 leaders of the Muslim world. This is something that was epic," Trump said, according to audio of the event obtained by The Intercept.

President Donald Trump with Abu Dhabi Crown Prince Mohammed bin Zayed Al Nahyan at the Gulf Cooperation Council Summit, at the King Abdulaziz Conference Center, May 21, 2017, in Riyadh, Saudi Arabia. AP Photo/Evan Vucci

"We were with the king, King Salman of Saudi Arabia, and as you know through Saudi Arabia, Qatar, and others, hundreds of millions of dollars on a monthly basis goes toward funding terrorist and terrorism and radical Islamic terrorism, and I said, 'It has to stop.,'" Trump told the audience, who paid $35,000 a person to attend. "And we said, 'You have to stop. You have to.' And the king was fantastic."

"We’re having a dispute now with Qatar, sometimes referred to as Qatar," the president added, switching between pronunciations of the country's name. "We all say Qatar. It's Qatar, they prefer. I prefer that they don’t fund terrorists," he said, to laughter and applause.

To some, Trump's early embrace of Saudi Arabia — coupled with his decidedly anti-Iran rhetoric — emboldened Riyadh, which is now testing the limits of Washington's allegiance by settling old scores in its neighborhood.

Under King Salman, who took the throne in 2015, and his crown prince, Muhammad Bin Salman, Saudi Arabia has become more assertive in the region, invading Yemen and bashing Iran.

The White House has called the Qatar crisis "a family issue" the countries involved "should work out for themselves." But the clash has set off a competition in the US capital, where diplomats and lobbyists are hustling to make their pitches.

US Secretary of State Rex Tillerson with Qatari Foreign Minister Sheikh Mohammed bin Abdulrahman Al Thani in Washington, June 27, 2017. Thomson Reuters

Tillerson this week has met with top Qatari officials and with the Kuwaiti foreign minister. The Saudi foreign minister, Adel Al Jubeir, has also been in close contact with Tillerson. Journalists, hustled from one embassy to another to hear each side's case, have been offered work writing essays in support of Qatar.

"This is the capital of the world," Al Jubeir said at Saudi Arabia's US embassy on Tuesday. "Washington is lovely in the spring," he added.

Qatar — whose emir said in late May that "there is no wisdom in harboring hostility towards Iran" — has for the time being spurned demands from the Saudi bloc, drawing closer to Iran. Tehran has said the "siege of Qatar is not acceptable for us" and that it will stand by Doha "as a ... friendly nation."

US officials — who are still facing a post-ISIS competition for influence in Syria (Iran, Saudi Arabia, Qatar, and the US all support different sides in Syria) and further conflict in Iraq — have been left frustrated by a Saudi policy, seemingly encouraged by Trump, that appears to be counterproductive.

“The Saudis and Emiratis have told us repeatedly that they want to weaken Iran, but they’ve actually empowered them,” a senior Pentagon consultant who works on the Middle East told Perry.

Iranian President Hassan Rouhani at the annual pro-Palestinian rally marking Al-Quds Day in Tehran, Iran, June 23, 2017. Thomson Reuters

"This is bigger than the chemical weapons in Syria. It's bigger than the Mosul fight in Iraq," said Ambassador James Jeffrey, the US's former envoy to Turkey and Iraq. "Because if the Qataris are threatened enough, they're going to turn to Russia and Iran."

The crisis in the Persian Gulf remains unresolved, and Qatar may yet capitulate — in part or in whole — to Riyadh's demands, solidifying the latter's position in the region and deepening the Sunni-Shia conflict.

But the potential also remains for Saudi Arabia's hardline to blow up in its face. Should Oman and Kuwait also defy Riyadh's power play, it could spell the end for the Gulf Cooperation Council and give Iran the chance to make new friends in its near abroad.

"This isn’t just some kind of Gulfie dust-up, where we can go out and hold everyone’s hands,” the Pentagon consultant told Perry. "The Saudis have handed the Iranians a gift and we’re on the outside looking in."