The cave was discovered in the 19th century during tunnelling work on the Rock of Gibraltar. It has less deposits than the higher caves like St. Michael's Cave.[2] In 1901 the Admiralty decided to convert the cave so that it could be used as a magazine and they arranged for the approach to be lined with bricks because the ground was made up of red sand.[3] The magazine took four years to complete.[4]
By the start of the First World War a complex of sixteen magazines was operational, served by two parallel spine tunnels directly linked to HM Dockyard, Gibraltar by a long access tunnel.[5]
In 1943 the magazine was nearly the site of a major explosion during Gibraltar's part in World War II. José Martín Muñoz a Spaniard working in Gibraltar created an explosion and fire at a fuel tank at Coaling Island on 30 June 1943. He was under suspicion and in August 1943 he was arrested as he attempted to place a bomb inside this fully loaded magazine.[6] Muñoz was hanged in January 1944 in Gibraltar by Albert Pierrepoint.
There is debate but no conclusion over the origin of the name "Ragged Staff" which is associated with the nearby Ragged Staff Gates. One of the possibilities is that it is from the symbols for Morvidus who was a legendary Earl of Warwick. He fought and killed a giant using an uprooted tree, hence the symbol of a ragged staff, but there is no consensus.[7]
The cave is at sea level and contains submerged passages and brackish lakes.[2]