Oman’s ruler, the British-educated Sultan Qaboos bin Said, has died, state media has reported.

Aged 79, he was the Middle East’s longest-ruling monarch.

Sultan Qaboos seized power by overthrowing his father in a 1970 palace coup and pulled his Arabian sultanate into modernity while carefully balancing diplomatic ties between adversaries Iran and the US.

The state-run Oman News Agency announced his death on its official Twitter account.

Oman state TV later said that Haitham bin Tariq Al Said is Oman’s new sultan. sultan. reported that authorities have an open letter by Sultan Qaboos naming his successor.

The sultan was believed to have been in poor health in recent months, and travelled to Belgium for a medical check-up last month. The royal court declared three days of mourning.

The reclusive sultan reformed a nation that was home to only three schools and harsh laws banning electricity, radios, eyeglasses and even umbrellas when he took the throne.

Under his reign, Oman became known as a welcoming tourist destination and a key Middle East interlocutor, helping the US free captives in Iran and Yemen and even hosting visits by Israeli officials while pushing back on their occupation of land Palestinians want for a future state.

“We do not have any conflicts and we do not put fuel on the fire when our opinion does not agree with someone,” Sultan Qaboos told a Kuwaiti newspaper in a rare interview in 2008.

Oman’s longtime willingness to strike its own path frustrated Saudi Arabia and the United Arab Emirates, longtime foes of Iran who now dominate the politics of regional Gulf Arab nations. How Oman will respond to pressures both external and internal in a nation Sultan Qaboos ruled absolutely for decades remains in question.

“Maintaining this sort of equidistant type of relationship … is going to be put to the test,” said Gary A Grappo, a former US ambassador to Oman. “Whoever that person is is going to have an immensely, immensely difficult job. And overhanging all of that will be the sense that he’s not Qaboos because those are impossible shoes to fill.”

Authorities never disclosed what malady the sultan faced, but a December 2019 report by the Washington Institute for Near-East Policy described him as suffering from “diabetes and a history of colon cancer”.

Sultan Qaboos spent eight months in a hospital in Germany, returning to Oman in 2015, with the royal court only saying that the treatment he received was successful.

In December 2019, he travelled to Belgium for a week for what the court described as “medical checks”. On December 31, 2019, the royal court described him as being in a stable condition.

Sultan Qaboos cut a fashionable figure in a region whose leaders are known for a more austere attire. His colorful turbans stood out, as did his form-fitting robes with a traditional curved khanjar knife, the symbol of Oman, stuck inside.

The sultan’s willingness to stand apart was key to Oman’s influence in the region. While home only to 4.6 million people and with smaller oil reserves than its neighbours, under Sultan Qaboos the country routinely influenced the region in ways others could not.

Oman’s oil minister routinely criticises the policies of the Saudi-led OPEC oil cartel. The capital Muscat hosts meetings of Yemen’s Houthi rebels, locked in a years-long bloody war with Saudi Arabia.

Sultan Qaboos’s outward-looking worldview could not have contrasted more sharply than that of his father, Sultan Said bin Taimur, under whose rule the sultanate more resembled a medieval state.

Slavery was legal, no one could travel abroad and music was banned. At the time, the country, which is nearly the size of Poland, had only 10 kilometres (6.2 miles) of paved roads.

Yet Sultan Said let his son Qaboos, born in Salalah on November 18, 1940, travel to study in England. His time abroad included schooling at Britain’s Royal Military Academy at Sandhurst and training with the Scottish Rifles Regiment in what was then West Germany.

The UK became frustrated with Sultan Said, who had grown increasingly eccentric after surviving an assassination attempt and as communist rebels kept up their offensive in the sultanate’s Dhofar region.

A July 23, 1970 palace coup ended up with Sultan Said shooting himself in the foot before going into exile in London. Sultan Qaboos took power.

“Yesterday, Oman was in darkness,” he said after the coup. “But tomorrow, a new dawn will rise for Oman and its people.”

Sultan Qaboos quickly moved toward modernising the country, building the schools, hospitals and roads his father did not.

“You can see the sultan’s fingerprints,” Grappo said. “They’re just everywhere.”

Sultan Qaboos was briefly married to a first cousin. They had no children and divorced in 1979.