Thailand's King Bhumibol Adulyadej, the world's longest-reigning monarch, has died after 70 years as head of state.
The 88-year-old king was widely revered but had been in poor health in recent years, making few public appearances.
He was seen as a stabilising figure in a country hit by cycles of political turmoil and multiple coups.
Crown Prince Maha Vajiralongkorn will be the new monarch, the prime minister has said.
The announcement
After two days of speculation and rumours surrounding the king's deteriorating health, the palace announcement confirming his death finally came early on Thursday evening.
"His majesty has passed away at Siriraj Hospital peacefully," a statement said, adding he had died at 15:52 (08:52 GMT).
In a televised address to the nation, Prime Minister Prayut Chan-ocha said Thailand would hold a one-year mourning period, that flags would fly half-mast and all entertainment functions must be "toned down" for a month.
A wave of emotion swept through the crowd - Jonah Fisher, BBC News, Bangkok
Throughout the first part of the day the king's supporters had sung royal songs and recited prayers at Siriraj Hospital. Many wore carefully chosen colours - pink for good health or yellow, the royal colour.
Most knelt holding pictures of King Bhumibol, facing the part of the hospital where he was receiving treatment.
By early afternoon the mood had begun to change. With all of his children at his bedside, rumours were circulating that the 88-year-old had passed away.
The tears began to flow, and in between songs the call of God Save the King was shouted with an almost visceral desperation.
Then just before 19:00 local time, the news was official. A wave of emotion swept through the crowd. Many clung to each other and wept.
Thailand's father figure, a beacon of stability in a divided and worried country, had died. A new, more uncertain era has begun.
The succession
Although the prime minister said Crown Prince Maha Vajiralongkorn would become the new monarch, he added that the official proclamation would be made at a later date.
He said the crown prince had confirmed that he would perform his duty as heir to the throne, but had asked for time to mourn his father's death.