The people of Thailand celebrated King Bhumibol Adulyadej's 87th birthday with both joy and fear, as the ailing monarch failed to make a public appearance.

The king's doctors advised he should not attend the ceremony for his birthday because of poor health. The king has been hospitalised since early October when he had his gall bladder removed.

The crowd outside the old Royal Palace was entertained by fireworks and elephants festooned in lights, and lit candles to show their devotion to the king. Many were festive, but the VIPs at the front of the crowd, including from the military – which staged a coup in May – looked serious.

The world's longest-reigning monarch has been visibly ailing for the several years. He spent almost four years in the hospital until leaving in August 2013.

When he was admitted in 2009, doctors said he was suffering from a lung inflammation, though he also suffers from a variety of ailments associated with age.

Thais hold great affection for Bhumibol, who took the throne in 1946. Next in line is Crown Prince Vajiralongkorn, who does not command the same respect and affection as the king.

In recent weeks, members of the family of his wife, Princess Srirasm, have been arrested on charges of abusing their connections for financial benefit.