Beating Retreat has its origins in the early years of organised warfare when the beating of drums and the parading of Post Guards heralded the closing of camp gates and the lowering of flags at the end of the day.
An order from the army of James II of England had his drums beating an order for his troops to retreat and a later order, from William III in 1694, read:
"The Drum Major and Drummers of the Regiment which gives a Captain of the Main Guard are to beat the Retreat through the large street, or as may be ordered. They are to be answered by all the Drummers of the guards, and by four Drummers of each Regiment in their respective Quarters".
Beating Retreat still continues today and takes place on Horse Guards Parade each year for two successive evenings in June. The ceremony has evolved into a colourful pageant of military music and precision drill carried out by the the Mounted Bands of the Household Cavalry and the Massed Bands of the Household Division.
The salute is taken by a member of the Royal Family.