Thailand's King Bhumibol Adulyadej, considered a unifying figure for many of his country's people, died in hospital on Thursday, the royal palace has announced.
The cause of his death was not given. He was 88 years old.
"His Majesty has passed away at Siriraj Hospital peacefully," the palace said, adding that he died at 1552 local time (0852 GMT).
The king was last seen in public in January. He had been receiving treatment for various health problems over the last two years, including regular infections, breathing difficulties, renal failure and hydrocephalus.
He was born on December 5, 1927, in the US state of Massachusetts, and was the world’s longest-serving head of state and the longest reigning monarch in Thai history.
His parents were Prince Mahidol Adulyadej and his commoner wife Mom Sangwan. He was educated in Switzerland.
On May 5, 1950 he was crowned king of Thailand after his brother Ananda Mahidol was found shot to death. Two royal pages and a former private secretary to the king were executed for the murder, but there has been speculation – including from the late King Bhumibol himself –that they were not responsible.
For the majority of the country's 68 million people, the king was a pillar of stability in rapidly changing times. Thailand embraced industrialisation during his reign but also saw its parliamentary democracy interrupted by 10 military coups, the most recent of which took place in May 2014.
The king was the only Thai monarch to hold a patent. He was a jazz enthusiast, loved photography and authored a book.
Although he was held in great respect by many Thais, he was also protected by laws which allowed his critics to be jailed from three to fifteen years.
The laws were later toughened to prevent criticism of any member of the royal family, royal development projects, the royal institution, the Chakri Dynasty or any previous Thai king.
Bhumibol had been in poor health for some time and spent most of the past six years in Bangkok's Siriraj hospital.
King Bhumibol was re-admitted in May 2015 and was last seen in public in January, when he spent several hours visiting his Bangkok palace.
The Royal Household Bureau in its statement on Thursday did not give a reason for the king's death. The king had been treated for a respiratory infection, a buildup of fluid surrounding the brain and a swollen lung in the past few months.
His son and heir apparent, the 63-year old Crown Prince Maha Vajiralongkorn, is expected to become Thailand's new king.
He has taken a more prominent part in royal ceremonial and public appearances in recent years, but does not command the same level of devotion as his father.