The EU has agreed to insert a clause in Brexit negotiations which force the UK to reach an agreement with Spain over the future of the territory. The Spanish ceded it to Britain in the 1713 Treaty of Utrecht but have continued to lay claim to it since.
While the UK as a whole voted 52-48 in favor of Brexit, 96 percent of Gibraltar residents voted to stay in the bloc.
Last week, Gibraltar's Chief Minister Fabian Picardo said that the territory would fight any attempt by Spain to use Brexit negotiations to bolster its claim.
"Our sovereignty is not in play," Picardo told Gibraltar's parliament on Wednesday.
"We will be no pawn in Brexit and no victim of Brexit."
Some leading politicians in the UK have suggested that the UK might use military means to defend its overseas territory.
Defense Secretary Michael Fallon said the UK is prepared to go "all the way" to make sure Gibraltar remains part of the UK, while former Conservative Party leader Lord/Michael Howard drew a comparison with the 1982 Falklands War with Argentina.
"Thirty-five years ago this week, another woman Prime Minister sent a taskforce halfway across the world to defend the freedom of another small group of British people against another Spanish-speaking country, and I'm absolutely certain that our current Prime Minister will show the same resolve in standing by the people of Gibraltar," Howard said.
"The debate about Gibraltar has lasted three centuries and now it's in an impasse. The thing is that Gibraltar is very small – just six square kilometers and only 30,000 people – and doesn't have much income," she said.
However, the island serves as an important port and base for many European companies. These ties mean that the British territory has a closer relationship with the EU than the UK mainland.
"Gibraltar has a very large port that it charges money to use, for the repairing of ships, parking vessels and all other port services. In addition, there are a huge number of European companies registered in Gibraltar, particularly in the online betting industry, since this is an offshore zone," Cherkasova said.
However, the analyst said she is skeptical about claims from the UK that the country might take military action to defend Gibraltar from Spain.
"I can't imagine that happening. In fact, the UK and Spain have very good relations with regard to everything apart from Gibraltar. A huge number of British tourists spend the summer in Spain or have property there. A lot of Spaniards with and live in the UK, or travel there for seasonal work. In addition, conservative governments are in power at the moment in both countries, they are ideologically close to one another."
As it withdraws from the EU, the UK "will have to take the interests of Gibraltar residents into account," but the results of the referendum there don't have any special legal status.
"Yes, the referendum results were different from those on the UK mainland, but that doesn't have any legal consequences because in practice Gibraltar's are counted as part of the south-west part of the UK, as a part of Wales," she explained.