Ceremony of the Keys Ceremonies known as the Ceremony of the Keys are held in at least two locations in the United Kingdom : London , and Edinburgh , as well as Gibraltar . London . Probably the best known such ceremony is the one that takes place every night at the Tower of London , and has done so in some form or another since the 14th century . At exactly 9 . 53pm , the Chief Yeoman Warder , dressed in Tudor Watchcoat , meets the military escort , made up of members of the Tower of London Guard . Together , the Chief Yeoman Warder and the Yeoman Warder ' Watchman ' secure the main gates of the Tower . Upon their return down Water Lane , the party is halted by the sentry and challenged to identify themselves : Following this , the party makes its way through the Bloody Tower Archway into the fortress , where they halt at the bottom of the Broadwalk Steps . On the top of the Stairs , under the command of their officer , the Tower Guard present arms and the Chief Warder raises his hat , proclaiming : He then takes the keys to the Queen ' s House for safekeeping , while the Last Post is sounded . As with many events of ceremony in the United Kingdom , it takes some significant outside influence to interrupt the Ceremony of the Keys . The one time when the ceremony was interrupted was during the Second World War , when there was an air raid on London , and a number of incendiary bombs fell on the old Victorian guardroom just as the Chief Yeoman Warder and the escort were coming through the Bloody Tower archway . The shock and the noise of the bombs falling blew over the escort and the Chief Yeoman Warder , but they stood up , dusted themselves down , and carried on . The Tower holds a letter from the Officer of the Guard apologising to King George VI that the ceremony was late , along with a reply from the King which says that the officer is not to be punished as the delay was due to enemy action . Edinburgh . There is also a Ceremony of the Keys held in Holyrood Palace , at the start of the British monarch ' s week - long residence there in July . Soon after the monarch ' s arrival , in the forecourt of the Palace , the Queen or King is symbolically offered the keys to the city of Edinburgh by the Lord Provost . The monarch returns the keys , saying : At the start of the General Assembly of the Church of Scotland , there is also a ceremony of the keys when the Lord High Commissioner , as the Monarch ' s representative , receives the keys from the Lord Provost . Gibraltar . The Ceremony of the Keys event is a re - enactment of the locking of the gates to the old Town and garrison of Gibraltar . During the 18th and 19th centuries , the sea came up to the defensive walls and there were four outer gates through which the town could be entered . Four keys locked these entrances to the town . The ceremony ' s origins date from the Great Siege of Gibraltar , which started in 1779 when French and Spanish troops attempted to capture Gibraltar . The keys were kept by the Governor who would hand them to the Port ( Gate ) Sergeant each evening at sunset , so that the four land entrances could be locked shut . The Gate Sergeant with an escort consisting of several armed soldiers , fife and drums would then march to each of the four gates in turn . He would be challenged by the sentry at the gate with the same words as used in London . Once all the gates were locked , the keys would be returned to the Governor at The Convent . In the morning , the Port Sergeant would once again collect the keys to open the town . During the Great Siege , the Governor , General Sir George Augustus Eliott , reputedly would carry the keys with him everywhere ; it was rumoured he slept with them under his pillow at night . The ceremony was reinstituted in 1933 and is currently performed twice a year ( in April and October ) by the Royal Gibraltar Regiment and visiting British units and bands . In the modern version of the ceremony , at the firing of the sunset gun , the Governor of Gibraltar symbolically hands the keys of the fortress to the Port Sergeant . The Port Sergeant , accompanied by an armed escort , marches away to symbolically lock the gates of the fortress for the night before returning the keys to the Governor . The party is also accompanied by drum s and fifes , to sound a warning for aliens to leave the colony before the gates are closed . The Ceremony is held only at one of the four gates , Grand Casemates Gates ( the old Waterport Gates ) at Casemates Square . At official dinners at the Governor ' s residence , the Keys are piped in by the Port Sergeant who hands them to the Governor declaring the fortress to be locked and safe , these are then placed on a cushion on the table where they remain during the meal .