Oman's Sultan Qaboos bin Said, one of the Middle East's longest serving rulers who maintained the country's neutrality in regional struggles, died on Friday and state media said his cousin Haitham bin Tariq al-Said was named his successor.

Oman declared three days of official mourning with flags to be flown at half-mast for 40 days for the Western-backed Qaboos, 79, who ruled since taking over in a bloodless coup in 1970 with the help of former colonial power Britain.

State television broadcast images of the funeral procession driving down a road lined with palm trees. The casket, draped in the Omani flag, was then carried into Sultan Qaboos Grand Mosque in the capital Muscat, where prayers were being held.

State news agency ONA did not give a cause of death, but Qaboos had been unwell for years and spent a week in Belgium for treatment last month.

Qaboos had no children and had not publicly appointed a successor. A 1996 statute says the ruling family will choose a successor within three days of the throne becoming vacant.

Haitham bin Tariq was appointed on Saturday after the high military council called on the ruling family council to convene and choose a successor.

He had served as minister of national heritage and culture and had been appointed in 2013 by Qaboos to chair the main committee responsible for Oman's development.

He takes power as domestic challenges loom large, from strained state finances to high unemployment in the indebted oil producer, and at a time of heightened tension between Iran and the United States and U.S. ally Saudi Arabia.

A smooth succession was expected, Kristian Coates Ulrichsen of Texas-based Rice University's Baker Institute told Reuters.

"The wildcard is whether any of Oman's neighbors might try to pressure the new sultan as he settles into power - just as the Saudis and Emiratis tried to pressure Emir Tamim in the weeks and months after he assumed power in Qatar in 2013."