By Rachel Harvey
BBC News, Bangkok
The king left hospital to grant an audience at the royal palace
King Bhumibol Adulyadej of Thailand has marked his 82nd birthday with an audience for members of the royal family and senior politicians.
He left hospital for the first time since being admitted for what palace sources said were respiratory problems and loss of appetite in mid-September.
The monarch's health is a sensitive topic in Thailand, where strict laws restrict debate about the royal family.
An eve of birthday address and military parade were postponed indefinitely.
After the king left hospital, thousands of people lined the streets to watch his motorcade pass.
Dressed in formal regalia of white uniform, he was seen to wave to crowds from the window of his vehicle.
State television has shown pre-recorded footage of the audience at the palace with the king on a throne, wearing a gold-braided tunic over his uniform.
The king's son, Crown Prince Maha Vajiralongkorn, Prime Minister Abhisit Vejjajiva, and the speaker of parliament all gave formal addresses, wishing the king well.
Then, watched by millions across the country, the king gave a brief statement in reply - the first time his voice has been heard in public since his illness.
He said his happiness and prosperity would be assured if Thailand flourished and was in a normal and stable situation.
The country would reach that state if everyone in the country fulfilled their duty with awareness and honesty, putting the concerns of the public above all else, he added.
"I ask all of you here who have very important positions in the main institutions of the country" the king said, "to clearly understand your duty and fulfil it with dedication for the good of the country."
The king has now returned to hospital, but this brief public appearance will have given hope to millions of Thais.
They have been hoping for signs that the man often described as the one truly unifying figure in a politically divided country is on the road to recovery.
King Bhumibol, the world's longest-serving monarch, is treated with reverent devotion.
His portrait hangs in shops, offices and on roadside billboards.
Thais stand respectfully for the royal anthem, which is played in cinemas before every screening of every movie.
His birthday is a time of national celebration, but this year there has been unspoken anxiety because of the king's hospital stay.
Two years ago, royal astrologers decreed that the colour pink was auspicious for the king's wellbeing.
In recent days, as the king's birthday approached, increasing numbers of Thais have been seen sporting bright pink shirts.