Thailand's people woke up on Friday to the first day in 70 years without King Bhumibol Adulyadej, a king worshipped as a godlike figure who guided the nation through decades of change and turmoil.
The king, the world's longest-reigning monarch, died in a Bangkok hospital on Thursday. He was 88.
He had been in poor health for several years but his death has shocked the Southeast Asian nation of 67 million people and plunged it into mourning.
Anguish rippled through the crowd of hundreds praying outside the king's hospital when his death was announced.
"We came here hoping for a miracle. We hoped the news wasn't true," said lawyer Pimook Linpaisarn, 32.
Crown Prince Maha Vajiralongkorn is expected to be the new king but he does not command the same adoration that his father earned over a lifetime on the throne.
Thailand has endured bomb attacks and economic worries recently while rivalry simmers between the military-led establishment and populist political forces after a decade of turmoil including two coups and deadly protests.
Military government leader Prime Minister Prayuth Chan-ocha said the country was in "immeasurable grief ... profound sorrow and bereavement".
He said security was his top priority and called for businesses to stay active and stock investors not to dump shares. Banks and financial markets are to stay open on Friday, industry officials said.
Security was stepped up in Bangkok's old quarter of palaces, temples and ministries with soldiers at checkpoints, government offices and intersections.
In the early hours of Friday, black-and-white footage of the king playing jazz on the saxophone was being shown on all local television channels.
Prayuth said the king's son, Prince Vajiralongkorn, wanted to grieve with the people and leave the formal succession until later, when the president of parliament will invite him to ascend the throne.
Thailand's strict lese-majeste laws have left little room for public discussion about the succession.
Prayuth told people to avoid festivities for 30 days of mourning. The state sector will observe a year of mourning.
Most Thais have known no other monarch and King Bhumibol's picture is hung in almost every house, school and office.
Until his later years, he was featured on television almost every evening, often trudging through rain, map in hand and camera around his neck, visiting a rural development project.
The death of Thailand's King Bhumibol Adulyadej has increased uncertainty around US President Barack Obama's diplomacy Asia, less than a month before the presidential elections.
The king was important in cementing the long-standing alliance between the United States and Thailand after World War II, in a reign that spanned the Vietnam War and development of the Association of Southeast Asian Nations (ASEAN).
King Bhumibol's death coincides with faltering momentum in Obama's policy of rebalancing the US security focus to the Asia-Pacific region in the face of China's rapid rise.
The main economic pillar of the rebalance, the 12-nation Trans-Pacific Partnership trade deal, is languishing in the US Congress with no guarantee that Obama will be able to push it through before leaving the presidency to Hillary Clinton or Donald Trump, both of whom say they oppose the deal.
Obama's efforts to boost security ties with Southeast Asia have come in response to China's pursuit of territorial claims in the South China Sea, a vital strategic waterway.
Thailand was already occupying a back seat in regional affairs following a 2014 military coup seen as a means to maintain stability during the king's long illness. Thailand is expected to turn further inward during a prolonged mourning period and potentially politically fragile royal succession.
King Bhumibol's son, Crown Prince Maha Vajiralongkorn, who is expected to become Thailand's new king, lacks the strong connection to the United States of his father, who was born in Cambridge, Massachusetts.
Obama offered condolences to the Thai people and the King's family, calling King Bhumibol "a tireless champion of his country's development."
Obama's former top Asia adviser, Evan Medeiros, now at the Eurasia Group, said the mourning process would likely slow a return to democratic government and Prince Vajiralongkorn was a source of "profound uncertainty."
"He's such an unknown, unpredictable figure," he said.