Fabian Picardo told Sky News television that Spain might close the frontier gates with the British overseas territory if Britain votes to leave the European Union in a membership referendum on , choking the peninsula of workers and land access to the continent.
Gibraltar's thriving services-based economy relies in large part on access to the EU's single market.
Picardo said Brexit supporters “would have a lot to answer for” if Madrid raised the possibility of joint sovereignty over the Rock – hitherto anathema to its 30,000-odd residents.
In case of a Brexit, the chief minister said: “The current Spanish foreign minister (Jose Manuel Garcia-Margallo) has been explicit as to what that may mean.
“They've said that they might consider closing the frontier if the United Kingdom were to leave the European Union.
“And if Gibraltar wanted to continue to have access to the single market and the rights that we enjoy today of free movement, that we would have to once again consider the issue of joint sovereignty with Spain – which nobody in Gibraltar is prepared to consider.”
Spain ceded Gibraltar to Britain in perpetuity in 1713 but has long argued that it should be returned to Spanish sovereignty, and the territory remains a source of diplomatic tension.
In 2002, the Labour government of prime minister Tony Blair said Britain was willing to share sovereignty with Spain over Gibraltar.
The territory, which is internally self-governing, swiftly held a referendum on the idea, in which 98.5 percent voted no.
Britain leaving the EU would “seriously impair” London's ability to stand up for Gibraltar, Conservative British Foreign Secretary Philip Hammond warned earlier this month on his first official visit to Rock.
Spain shut its gates on the solitary crossing with Gibraltar in 1969, fully reopening them in 1985 ahead of it joining the EU's predecessor, the European Economic Community, the following year.
Inhabitants had to rely on air and sea links, typically via Britain or Morocco, to reach the other side of the 1.2-kilometre border.
Gibraltarians have the right to vote in Britain's EU referendum.
With less than four weeks to go until the vote, the Remain campaign is on 53 percent support and the Leave camp on 47 percent, according to the What UK Thinks website's average of the last six polls.