Thailand's King Bhumibol Adulyadej - the world's longest-reigning monarch - has left a Bangkok hospital after a seven-month stay.
Crowds lined the streets and cheered as the 87-year-old king was driven from the capital, Bangkok, to the royal palace in the coastal town of Hua Hin.
The monarch has been in poor health for some years.
He is revered by Thais and is often seen as an arbiter in the country's divided political arena.
The king left Siriraj Hospital as planned accompanied by Queen Sirikit, 82, and their daughter, Princess Sirindhorn. They travelled in three separate vehicles.
The king had initially gone into hospital last October to have his gall bladder removed.
Since then he has rarely been seen in public, although he did leave last week to celebrate the 65th anniversary of his coronation at a ceremony at the royal palace in Bangkok.
It is not the first time he has had a long stay in hospital - he spent four years getting treatment before being released in 2013.
The king's popularity stems partly from his long reign - he ascended the throne in 1946. He is also seen as a pillar of stability in Thailand.
Although he has no formal political role, many think he is needed now more than ever. Thailand is currently governed by the military, which took power in a coup last year.
General Prayut Chan-ocha led the takeover and is now the country's prime minister. He has promised to hand back power to a civilian government, but there is no firm timetable for when that will happen.