Based on a story on BBC here
The Last Post was first published in the 1790s. It was just one of the two dozen, or so bugle calls sounded daily in British Army camps. The inspection would take about 30 minutes, and at the end there would be sounded the Last Post, the name simply confirming that the final sentry-post had been inspected. Traditionally, it is played on a bugle.
The sound of a lone bugler playing the Last Post has become one of the most distinctive sounds in the world. Eerie and evocative, it exists beyond all the usual barriers of nation, religion, race and class, charged with the memory of generations of the fallen.
But, from the 1850s onwards, it became customary for the regimental bugler to sound the Last Post over the grave of any soldier who died overseas, where often there was no other music available to accompany him on his final journey. Over time the custom was adopted at home as well as abroad and, by the time World War I broke out in 1914, it was routinely played at soldiers’ funerals.
The tune, which has gone from 45 seconds to 75 seconds, has also been played at the funerals of political leaders: this includes Mahatma Gandhi and Nelson Mandela.