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.

thailand king bhumibol
Military cadets attend a ceremony celebrating the birthday of Thailand's King Bhumibol Adulyadej outside the Grand Palace in Bangkok. The world's longest-reigning monarch cancelled a public appearance on the advice of doctorsDamir Sagolj/Reuters
thailand king bhumibol
Military cadets take pictures of each other during a ceremony celebrating King Bhumibol Adulyadej's 87th birthday outside the Grand Palace in BangkokDamir Sagolj/Reuters
thailand king bhumibol
Damir Sagolj/Reuters
thailand king bhumibol
Damir Sagolj/Reuters
thailand king bhumibol
Thai student nurses hold candles in front of the Grand Palace on the occasion of King Bhumibol Adulyadej's 87th birthdayNicolas Asfouri/AFP
thailand king bhumibol
Thai Prime Minister Prayut Chan-o-cha holds a candle in front of a giant portrait of King Bhumibol Adulyadej in front of the Grand PalaceNicolas Asfouri/AFP
thailand king bhumibol
Thailand's Prime Minister General Prayut Chan-o-cha and other officials celebrate the birthday of Thailand's King Bhumibol Adulyadej outside the Grand Palace in BangkokDamir Sagolj/Reuters

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.

thailand king bhumibol
Crowds of well-wishers gather at Siriraj hospital to pray for King Bhumibol AdulyadejAthit Perawongmetha/Reuters;
thailand king bhumibol
Well-wishers look toward the hospital where Thailand's King Bhumibol Adulyadej is spending his 87th birthdayDamir Sagolj/Reuters
thailand king bhumibol
A woman prays for the king's health outside the hospital in BangkokDamir Sagolj/Reuters
thai king bhumibol
A well-wisher cries under the Siriraj hospital in Bangkok, where Thailand's King Bhumibol Adulyadej is residing. The country's beloved monarch cancelled a public appearance on his 87th birthday on the advice of doctorsDamir Sagolj/Reuters
thailand king bhumibol
A giant portrait of King Bhumibol Adulyadej hangs on the facade of Siriraj Hospital in BangkokBorja Sanchez-Trillo/Getty Images

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.