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.
In a later statement he urged vigilance, saying national security was a top priority.
"Everyone will need to be alert in every region and throughout the country to ensure safety," he said.
The king's death comes as Thailand remains under military rule following a coup in 2014.
A palace official, speaking to crowds outside the hospital, said the body of the king would be moved to the Temple of the Emerald Buddha in Bangkok on Friday.