The livelihood of some 300,000 Spaniards who work in Gibraltar is on the line as Britain prepares to leave the European Union. Being in the EU has meant the territory’s border has been open to an unlimited flow of workers, goods and money, but that could end if Britain leaves the EU without retaining access to the bloc's single market.

Britain has controlled the territory for three centuries against Spain's wishes.

EU CITIZENS IN UK ANXIOUSLY SEEK SECURITY BEFORE BREXIT

"It's unfortunate. We don't want to turn our backs to Europe, but those are the cards that we have been dealt and we have to play this hand the best as possible," Fabian Picardo, the chief minister of Gibraltar, told The Associated Press.

An overwhelming 96 percent of Gibraltarians voted to remain in the EU in last year's referendum.

Spain is trying to use the situation to press for greater control of the territory, lost to Anglo-Dutch forces in 1704, by blocking pleas for a special deal that would allow Gibraltar to keep borders open — Spain wants joint sovereignty of the territory.

Gibraltar, which is barely twice the size of Central Park and home to 32,000 people, has thrived economically under Britain's rule. Its low corporate taxes, business-friendly regulation and links to the EU market since 1973 have attracted investment.

BREXIT EXPLAINED: WHAT'S NEXT ON THE UK'S ROAD OUT OF THE EU

All that is needed to cross the border into Gibraltar for work today is an identity card.

"There is much fear because we don't know what's going to happen," said Antonio Molina, a Spanish delivery man who works on Gibraltar. He is applying for his first passport ever in case border controls become stricter.

"We live in limbo; you hear one thing today and a different thing tomorrow," he said.

Nobody expects Gibraltar's border to be fully closed. But disruptions and queues — which already happen at times of diplomatic tensions between Britain and Spain — are a nightmare for workers and employers.

Britain's government will begin the process of leaving the European Union on March 29, starting the clock on the two years in which to complete the most important negotiation for a generation.

The AP contributed to this report.