The town-guard was a law enforcement body that carried out the function of an armed local police force. It consisted of three large companies, each of which was presided over by a lieutenant. Edinburgh’s guard was established in 1682 and was responsible for maintaining order in the city until its dissolution in 1817. Notoriously inefficient, the guard is described thus by Robert Chambers:
"Composed for the most part of old Highlanders, of uncouth aspect and speech, dressed in a dingy red uniform with cocked hats, and often exchanging the musket for an antique native weapon called the Lochaber axe, these men were (at least in latter times) an unfailing subject of mirth to the citizens."