DUBAI, UNITED ARAB EMIRATES -- Oman's Sultan Qaboos bin Said, the Mideast's longest-ruling monarch who seized power in a 1970 palace coup and pulled his Arabian sultanate into modernity while carefully balancing diplomatic ties between adversaries Iran and the U.S., has died. He was 79.

The British-educated, 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 Mideast interlocutor, helping the U.S. 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 state-run news agency announced his death early Saturday, but offered no cause. The royal court declared three days of mourning. Following Islamic tradition, the sultan was buried before nightfall.

The sultan's death had raised the risk of unrest in this country on the eastern edge of the Arabian Peninsula. The unmarried Sultan Qaboos had no children and did not publicly name an heir, a tradition among the ruling Al Said dynasty whose history is replete with bloody takeovers. But within hours, Oman state television announced Haitham bin Tariq Al Said, who had served as the sultanate's culture minister, as the new sultan.

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 absolutely ruled 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 U.S. 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."

The sultan had been believed to be ill for some time, though authorities never disclosed what malady he faced. A December 2019 report by the Washington Institute for Near-East Policy described the sultan 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." Days of worry about his condition ended Dec. 31, 2019, with the royal court describing him to be in 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 stuck inside, the symbol of Oman. He occasionally wore a white turban out of his belief that he spiritually led Oman's Ibadi Muslims, a more liberal offshoot of Islam predating the Sunni-Shiite split.

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

Oman's oil minister routinely criticizes the policies of the Saudi-led OPEC oil cartel with a smile. Muscat hosts meetings of Yemen's Houthi rebels, locked in a yearslong bloody war with Saudi Arabia. When Americans or dual nationals with Western ties are detained in Iran or areas under Tehran's influence, communiques that later announce their freedom routinely credit the help of Oman.

The sultan's greatest diplomatic achievement came as Oman hosted secret talks between Iranian and U.S. diplomats that led to the 2015 nuclear deal between Tehran and world powers. The agreement, which limited Iran's atomic program in exchange for the lifting of economic sanctions, has come unraveled since President Donald Trump withdrew from it in May 2018.

Even while mediating negotiations with Tehran, the sultan maintained ties to those in the Pahlavi dynasty that Iran's 1979 Islamic Revolution overthrew.

U.S. President Donald Trump issued a statement saying that the sultan "brought peace and prosperity to his country and was a friend to all. His unprecedented efforts to engage in dialogue and achieve peace in the region showed us the importance of listening to all viewpoints."

Sultan Qaboos' 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.21 miles) of paved roads.

Yet Sultan Said let his son Qaboos, born in Salalah on Nov. 18, 1940, travel to study in England. Qaboos' 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.

Qaboos returned to Salalah in 1964 but found himself instead locked away in a palace. Music cassettes sent to him from friends abroad included secret messages from the British. London was 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. Qaboos took power.

"Yesterday, Oman was in darkness," Sultan Qaboos said after the coup. "But tomorrow, a new dawn will rise for Oman and its people."

Sultan Qaboos quickly moved toward modernizing the country, building the schools, hospitals and roads his father didn't. With the help of Iranian forces under Shah Mohammad Reza Pahlavi, the British and Jordan, the sultan beat back the Dhofar rebellion.

"You can see the sultan's fingerprints," Grappo said. "They're just everywhere."

Over time, Sultan Qaboos introduced what amounted to a written constitution, created a parliament and granted citizens limited political freedoms. But the sultan always had final say. In a sign of his strong grip, he also served as prime minister and minister of defence, finance and foreign affairs, as well as governor of the sultanate's Central Bank.

"Holding all these positions in government probably sort of constrained his country in the sense of developing senior leadership," Grappo said.

That strong grip extended to any sign of dissent. The Royal Oman Police often patrol in riot-ready vehicles with chicken wire covering the windows, something only seen in the island nation of Bahrain which has faced years of low-level unrest. U.S. diplomats routinely describe the Omani press as "muzzled" and even private outlets self-censor out of fear of running afoul of so-called "red lines." All public gatherings require government permission.

Small protests broke out as part of the wider Arab Spring unrest in 2011, revealing discontent over corruption, unemployment and rising prices within the sultanate.

Oman was one of the few countries in the Arab world to maintain ties with Egypt after Egyptian President Anwar Sadat signed a peace treaty with Israel in 1979, and acted as a mediator between Iran and Iraq during their ruinous eight-year war. It has also long served as a quiet base for U.S. military operations, including a failed 1980 attempt to free hostages held by Iran after the U.S. Embassy takeover in Tehran.

As he grew older, Sultan Qaboos also grew increasingly reclusive. He is known to have had three major passions -- reading, music and yachting.

He "read voraciously," Grappo said, played the organ and lute. He created a symphony orchestra and opened a royal opera house in Muscat in 2011. His yacht "Al Said" is among the world's largest and was frequently seen anchored in Muscat's mountain-ringed harbour.

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

------

Associated Press writers Joseph Krauss and Aya Batrawy in Dubai, United Arab Emirates and Adam Schreck in Bangkok contributed to this report.