The flag of Gibraltar is an elongated banner of the coat of arms of Gibraltar, granted by Royal Warrant Queen Isabella I of Castile on 10 July 1502.
“An escutcheon on which the upper two thirds shall be a white field and on the said field set a red castle, and below the said castle, on the other third of the escutcheon, which must be a red field in which there must be a white line between the castle and the said red field, there shall be a golden key which hangs by a chain from the said castle, as are here figured”.
The flag of Gibraltar was regularised in 1982 and is formed by two horizontal bands of white (top, double width) and red with a three-towered red castle in the centre of the white band; hanging from the castle gate is a gold key centred in the red band. The flag differs from that of other British overseas territories, in that it is not a British ensign. The castle does not resemble any in Gibraltar, but is supposed to represent the fortress of Gibraltar. The key is said to symbolise the fortress’ significance. Wikipedia