Rarely does one get an opportunity to watch individuals and institutions mature before one’s eyes and in real time. This is one dimension of what is going on as we watch United States Secretary of State Rex Tillerson conduct his mediation shuttle around the Gulf this week. He is trying to help the Gulf Cooperation Council (GCC) states resolve a long-running dispute that erupted again five weeks ago when Saudi Arabia and the United Arab Emirates (UAE) and a few other less important states broke relations with Qatar, expelled its nationals, and laid siege to its land, sea, and air transport routes.

Tillerson and others in the U.S. government seem now to have the upper hand in shaping their country’s response to the crisis, having gotten Washington deeply, directly, and consistently involved in mediation—after the initial days when a typically clueless U.S. President Donald Trump came out in public supporting the anti-Qatar campaign. U.S. policy instead sees the Saudi-UAE thirteen non-negotiable demands of Qatar as unrealistic and unworkable, and demands a diplomatic settlement.

Virtually the entire world lined up with the sensible new American position, by doing several things. Major countries like Germany, Great Britain, France, Turkey and others directly engaged with Doha to explore the Qatari response to the accusations against it, openly seeing a diplomatic solution as possible and preferable to the siege warfare tactics that had been applied so brutally—but also so ineffectively, because the siege failed totally to achieve its objectives.

Qataris quickly found many alternative ways to communicate and trade with the world without using routes that crossed the territories of the siege-masters in Riyadh and Abu Dhabi. Qataris and their many friends around the world rallied to support them in the face of what almost every country on earth saw as an unreasonable, irrational, and impulsive strategy against Qatar.

This created unbearable pressure on the siege-masters, which caused them for once in this case to use their minds and good sense, and to issue a new statement last week which replaced the thirteen demands with six “principles” that they said Qatar should adhere to in order to resolve the crisis. These very reasonable and rational principles focus on fighting terrorism and violence, stopping the funding of terrorism, not interfering in the sovereign affairs of one’s neighbors, and other such sensible ways to conduct the affairs of state.

Qatar should have no problem accepting these principles, which will open the door to finding a resolution of the outstanding issues that bedevil its relations with the Saudis and Emiratis. Once the Americans became involved in direct diplomacy in support of the floundering Kuwaiti mediation attempt, it was obvious that we would see movement towards a settlement.

Tillerson this week said the Qatari positions in the last month have been “reasonable,” and a senior assistant to him was quoted as saying that no country is blameless and that all sides in this dispute are guilty of some bad behavior that they must change. So this week marks an important shift in the nature of this dispute—an immature and irrational outburst by inexperienced Saudi and Emirati leaders whose mismanagement of their feud with Qatar only damaged their own credibility in the eyes of the world, has become a more traditional political dispute between two parties that both have some degree of valid grievances against the other that they can only hope to resolve through honest negotiations that address the rights of both sides equally.

So it is no surprise that Tuesday, in Doha, Tillerson and the Qatari foreign minister signed an agreement by which the two countries will work together to prevent terrorism and stop the funding of terrorists anywhere in the world. We should not be surprised now if this memorandum expands in the coming weeks to miraculously coincide with the wording of the six principles that the Saudi-Emirati siege-masters issued in their refreshing interlude of rationality last week.

As Tillerson continues his GCC-wide shuttle diplomacy, and other mature adults like the Germans and European Union work with GCC states to monitor terror funding accusations, the big challenge will comprise two main issues: How can the GCC states craft an agreement that applies to all of them, and not only to one country? And how can they overcome the bitterness and lack of trust that has now erupted between them, so they can resume normal relations that benefit all their citizens, friends, and trading partners?

The answer to these two issues lays in the growing up process that individuals, organizations, and countries go through to achieve a stage of maturity that is critical for managing good relations with others. All parties in this dispute are learning important lessons about the business of statecraft, which will benefit them all in the long run.

Rami G. Khouri is senior public policy fellow and professor of journalism at the American University of Beirut, and a non-resident senior fellow at the Harvard Kennedy School Middle East Initiative. On Twitter: @ramikhouri.