A man died after setting himself on fire near the entrance to Kensington Palace, the home of Prince William and his family in London, police said.

Police were called just after Midnight Monday by a London hospital about a missing patient. After a search at three different locations, they found the man ablaze three hours later near Kensington Gardens, a representative for London's Metropolitan Police said.

Despite giving the man first aid at the scene, he was pronounced dead about 45 minutes later.

The man, who was in his 40s, was not identified by London Metropolitan Police. The man's death is not considered terrorism.

The man had been admitted to the hospital for mental health reasons. Police are investigating how the hospital conducted his leaving the premises.

Kensington Palace had no comment and it is not known if Prince William and his family were at the palace at the time of the incident.