After more than three years of intransigence and bitterness, rival Gulf states have finally moved to ease one of the Middle East’s most unseemly and extraordinary disputes. Saudi Arabia has lifted its air, sea and land embargo on Qatar. Riyadh’s allies, the United Arab Emirates, Bahrain and Egypt, are following suit.

There is justifiable scepticism over whether last week’s agreement will be sufficient to heal the deep wounds caused after the Arab quartet severed transport and diplomatic ties with Qatar, or will lead to a cold peace in which rivalries fester beneath the surface. But the rapprochement should be welcomed. Saudi Crown Prince Mohammed bin Salman also deserves some credit for pushing efforts to resolve the rift. From the moment Saudi Arabia and the UAE sought to force Qatar to submit to their will by imposing the embargo in June 2017, Riyadh and Abu Dhabi’s salvo against their smaller neighbour smacked of a bullying, poorly conceived act.

They accused Qatar, long considered a maverick, of supporting Islamist groups and being too cosy with Iran. Doha denied the allegations and used its gas riches to cushion the blow to its economy. It has emerged more confident in its ability to be independent from its larger neighbours. And rather than sever its ties to Iran, the boycott pushed Qatar closer to the Islamic republic, as well as Turkey, another nemesis of the UAE and Saudi Arabia, as it was forced to seek new trade routes and strengthen alliances.

Doha did not concede to the 13 maximalist demands that Riyadh and Abu Dhabi set, including closing the Al Jazeera television network and a Turkish military base in Qatar. But there are no winners. All sides have paid a human and financial cost. Saudi companies lost an export market; the UAE lost trade and tourism. Both suffered reputational damage. The Gulf Cooperation Council, which had been the region’s only functioning trade bloc, was undermined as its core tenets — unity and the freedom of movement and work among its six member states — were broken.

The sudden detente appears to be a direct result of Donald Trump’s election defeat. It was no coincidence that Saudi Arabia and the UAE imposed the embargo months after he took office, believing they had a like-minded ally as the US president raged against Iran. Mr Trump initially seemed to side with Riyadh and Abu Dhabi, apparently forgetting that Qatar hosts the biggest US military base in the region.

The Trump administration did belatedly pressure the rivals to end the dispute. But it is the prospect of Joe Biden’s presidency that has prompted Saudi Arabia’s embrace of its rival. In Mr Trump, Prince Mohammed knew he was assured of Washington’s backing, no matter his calamitous missteps or the abuses taking place under his watch. Now he needs to earn credit with team Biden, which has publicly criticised the human rights abuses in the kingdom and pledged to reassess the two countries’ relations. Easing the dispute with Qatar was the low-hanging fruit.

One positive gesture, however, should not ease the pressure or scrutiny over the more nefarious activities that have occurred during the crown prince's leadership, from the arbitrary detention of scores of businessmen, bloggers, academics and activists, to the murder of the journalist Jamal Khashoggi and Saudi Arabia’s catastrophic war in Yemen. Last month, a Saudi court sentenced Loujain al-Hathloul, a women’s rights activist, to nearly six years in prison despite international condemnation. If Prince Mohammed is seeking to rehabilitate his sullied reputation, he has far more to do.