Gibraltar is a Soverign State.
Its also one heck of a strategic position, its the only entrance to the mediteranian for ships, save the suez canal, and a rather efficient choke point, he who owns gibraltar could filter almost all the shipping going in and out of the mediteranian.