Its name is supposed to be derived from the Arabic "gibel Tarik" or "Tarik's Rock", from Tarik, the leader of the army that invaded Spain from North Africa in the 8th century. The area remained Moorish for centuries, until the Spanish retook it in 1309. It shuttled back and forth for a few decades and finally stayed under Spanish control until the British takeover. (http://www.gibraltar.gi/history/)