The king of Thailand's beloved pet dog has died, days after a man was charged with insulting the royal canine online.

Tongdaeng (Copper) was adopted by King Bhumibol Adulyadej as a puppy in 2002, and became well-known after the king praised its loyalty and obedience in a book outlining the virtues that Thais should abide by under his monarchical system.

Referred to using the honorific 'Khun', or 'Ma'am', the dog became something of a celebrity in Thailand, with the king's book about her outselling Harry Potter novels and the dog regularly featuring in official royal photographs.

Only days ago a factory worker was charged after making "sarcastic remarks" online about Tongdaeng. The worker could face up to 37 years in jail if found guilty of sedition, after also allegedly insulting the king in the posts.

In a statement on 28 December, the veterinary faculty of Kasetsart University announced that the pet at the centre of the furore had died.

The statement said that 17-year-old "Khun Tongdaeng" died while sleeping on 26 December at Klai Kangwon Palace, AFP reported.

The case had brought Thailand's harsh defamation laws into the spotlight, under which anyone found guilty of insulting the monarchy can be jailed for up to 15 years for each individual offence.

King Bhumibol is the world's longest-serving head of state, having been on the throne for 69 years. The 88-year-old is currently in ill health and being treated at a Bangkok hospital.