Image copyright Alamy

The UK will vote in June on whether it wants to leave the EU or remain. The residents of Gibraltar - the British overseas territory on the tip of Spain - will also have the right to cast a vote.

High up on the slope of the Rock of Gibraltar on the terrace of their home, lawyer and native Gibraltarian Damon Bossino can see how close Spain is - only five miles across the bay.

His Spanish wife Rosa is from La Linea, just across the Spanish border and they met 20 years ago when she came to work in the same law firm in Gibraltar.

"Rosa would most likely not have been here in Gibraltar if it weren't for the EU," says Damon. "No, that's true, we would never have met," says Rosa. "I feel Gibraltarian now and my kids are Gibraltarian too."

Being part of the European Union is not something that has ever been an issue for Gibraltarians, says Damon. "We are geographically connected with Europe. We are a melting pot of European cultures. So we don't have those hang-ups."

The ringtone on Rosa's mobile phone reminds Damon of one of their many worries. "You wonder if things like data roaming charges will go - would that come back in if Gibraltar weren't a member of the EU?"

Image caption The Bossino family worry that crossing between Gibraltar and Spain could be made much more difficult if the UK votes to leave the EU

But the couple have more serious fears than an expensive phone bill. It's all to do with the antagonism of Spain.

"The frontier," explains Damon, "could be shut if Spain became nasty, as it's capable of doing towards Gibraltar because of its sovereignty claim."

If that happens, Rosa says she would be devastated. "I don't want Britain to vote yes, because there is a possibility that the Spanish will decide to close the frontier. For me that would be, well the worst decision in my life because I cannot see my parents."

Gibraltarians are often said to be more British than the British. Walking down Main Street they have all the shops you would normally see on the British High Street - like Marks and Spencer and BHS. The iconic red telephone boxes are still in use, unlike most of the UK.

There's a military re-enactment group who march through town every Saturday with imitation rifles held at the shoulder, celebrating British victory over the Spanish.

Image caption Military re-enactment group: A weekly reminder of British victory over Spain

One might assume that this patriotic territory would share the concern of many Britons that the European Union was eroding UK sovereignty and want out. But the memory of a past when tensions between Spain and Gibraltar led to the border's closure from 1969 to 1985, forcing people to journey to and from the territory by sea, still casts its shadow.

It's not so much that all Gibraltarians love the European Union project, but rather that many see the EU as the only force standing in the way of a tricky relationship with Spain.

"Remember that Spain closed the frontier in 1969," says Chief Minister Fabian Picardo at 6 Convent Place, the government's headquarters. "It was only in the negotiations for the Spanish to access the then European Economic Community, that Spain finally opened the frontier. We see the EU as a guarantor of the freedom of movement of people."

Image caption Fabian Picardo, Gibraltar's chief minister

Picardo says some 10,000 people cross the border from Spain to work in Gibraltar daily and it's that freedom of movement of people and services that is vital to the economy. He believes the fears that the Spanish could shut the border again are justified because he says "they still get funny about it" and restrict or slow the flow of traffic across the border.

Recently Spain's acting Foreign Minister, Jose Manuel Garcia-Margallo, told Spanish National Radio that if Britain were to leave the EU "we would be talking about Gibraltar the very next day".

At the end of a working day there's a long line of cars queuing at the frontier to go back into Spain and the commuters I spoke to didn't think Brexit would be good for Gibraltar either. "We are so integrated and you've got great opportunity across the border as there's a lot of industry," says Paul, a Gibraltarian. "Having the UK separated by the Channel does lead to a sense of us and them between the UK and Europe."

Image copyright Getty Images Image caption Queuing up for the border patrol between Spain and Gibraltar

It's very difficult to find anyone who will say they are in favour of Britain leaving the EU, but finally I do find one man. He doesn't want to be named as he says the territory is too small and he would rather his neighbours didn't know his opinions. "I'm all in favour of Brexit because I put Britain first. It will have an effect on Gibraltar, but it'll be an effect that people will come to live with."

It's not an opinion shared by the president of the Chamber of Commerce in Gibraltar, Christian Hernandez, who believes Gibraltar's year-on-year GDP growth of 8% could be negatively affected. The pillars of the economy are financial services, online gaming, the port and insurance.

According to Hernandez, Gibraltar's lower tax rate means a huge number of cars in the UK are insured by a Gibraltarian company. "In our financial services one of the things Gibraltar does offer is that businesses here can 'passport' their services into Europe - particularly banking and insurance. If we take the EU out of that formula it could be bad for Gibraltar."

Image caption Red phone boxes are a reminder of Gibraltar's unique status

If the UK voted to leave it would mean that Gibraltar would be out of the EU. The British government would negotiate an exit and it's not known what those terms would be, but Gibraltar would be likely to push for the fullest access to the single market.

"It's not impossible to see that if the UK were to vote to leave the EU it would be negotiating a new status for access to the single market in which Gibraltar would want to piggyback that process," says Picardo. "There may even be arrangements which allow Gibraltar further integration into the single market than the UK might consider is appropriate for the mainland UK." In these unchartered waters success is not guaranteed, making Brexit a gamble the minister would bet against.

"If you believe some of the polls [in the UK]," says Picardo, "the vote might be on a knife edge and the 22,000 people of Gibraltar might just turn that".

The Rock of Gibraltar is one of the territory's main attractions, where Barbary Macaque monkeys wander about grooming one another and think nothing of jumping on your car.

From the viewpoint overlooking the 2.6-square mile British territory three flags fly in the breeze - the Union Jack, the Castle and Key flag of Gibraltar and that of the European Union.

But that complex mix of identity and allegiance may soon be hotly debated.

More from the Magazine

Image copyright Getty Images

The UK has always insisted Gibraltar is rightfully British. The Spanish government maintains the territory should pass back. But what are the details of each side's legal, historical and geographical claims for sovereignty?

What are the competing claims over Gibraltar? (August 2013)

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.