Bangkok (AFP) - Thailand's King Bhumibol Adulyadej, the world's longest-reigning monarch, has died at the age of 88, the palace announced Thursday, leaving a divided nation bereft of a rare figure of unity.
US President Barack Obama led global tributes to Bhumibol, whose death ends a remarkable seven-decade reign and plunges Thailand into a deeply uncertain future.
Most Thais have known no other monarch and he has been portrayed as a guiding light through decades of political turmoil, coups and violent unrest.
In a statement the palace said the king passed away at 3:52 pm (0852 GMT).
As the news filtered out, large crowds erupted in mourning outside the hospital where Bhumibol spent most of the last two years, many of them wailing and sobbing.
"How will Thailand live without you father?" cried one distressed young man as others chanted "Long Live the King!"
Prime Minister Prayut Chan-O-Cha, the former army chief who leads Thailand's ruling junta, described the king's passing as "the most devastating moment for Thais" since the death of his predecessor and older brother Ananda in 1946.
He moved quickly to declare that the king's 64-year-old son, Crown Prince Maha Vajiralongkorn, is the named successor.
The crown prince is much less well-known to Thais and has yet to attain his father's widespread popularity. He spends much of his time overseas, especially in Germany, and is a keen pilot.
- Year-long mourning -
In a televised address to the nation, Prayut said Thailand would hold a one-year mourning period and that all entertainment functions must be "toned down" for a month.
Trading on the Thai stock exchange would not be suspended, he added.
Bhumibol's death is a major test for the country's generals, who seized power in 2014 vowing to restore stability after a decade of political chaos, a turbulent period exacerbated by the king's declining health as jostling elites competed for power.
The military has deep links with the palace and many inside the kingdom saw the putsch as a move to ensure generals could stamp down on any instability during a succession.
It is difficult to overestimate Bhumibol's importance to most of his subjects.
Backed by an intense palace-driven personality cult, he is revered as a demigod by many, seen as rising above the kingdom's notoriously fractious political scene.
It is not unusual to see Thais moved to tears when they talk of a future without him.
Officially known as King Rama IX, he descended from the Chakri dynasty which came to power in Thailand in the late eighteenth century.
His subjects have had many years to get used to the prospect of no longer having Bhumibol -- their king has not been seen in public for months and has suffered prolonged ill health.
But his passing is still a huge shock to the nation.
His reign spanned a remarkable era in which Thailand transformed itself from an impoverished, rural nation into one of the region's most successful economies, dodging the civil wars and communist takeovers of its neighbours.
He built a reputation for criss-crossing the nation to visit the rural poor and sometimes intervened to quell key moments of political violence -- although other times he stayed silent and he approved most of the army's many coups during his reign.
In a statement Obama described Bhumibol as a "close friend" and "tireless champion" of his country's development. UN Secretary General Ban Ki-moon said he was a "unifying national leader... respected internationally".
- Criticism muted -
Any criticism or effective republican sentiment has been erased inside Thailand by a draconian lese majeste law, use of which has surged since the military’s latest takeover.
In recent years, and especially since the 2014 coup, the heir apparent Vajiralongkorn has made more frequent public appearances inside Thailand and taken on a larger number of royal engagements.
He will inherit one of the world's richest monarchies.
During his reign Bhumibol, with his establishment allies, built up a multi-billion-dollar-empire spanning property, construction and banks under the banner of the Crown Property Bureau (CPB).
Analysts say the CBP's vast reserves allowed the crown to build a deep network among the Thai elite, helping insulate the king from the political pressures felt by monarchs who rely chiefly on state funding.
The palace's announcement that the king was gravely ill sent shudders through the stock market and pushed the baht currency to a two-month low earlier this week.
"The death of Thailand's highly-revered king will plunge the country into a state of mourning, and also deep political uncertainty," Capital Economics said in a note.
"There is a risk that political tensions flare up, triggering a slowdown in economic growth," it said. "All eyes now will turn to the succession process."