The Rock's about 34,000 residents didn't want to leave the European Union — in the 2016 referendum, 96% voted to stay — and they are bracing to be hit hard if it comes to pass.
A possible Brexit agreement at an EU summit in Brussels on Thursday would still require ratification by EU member nations.
The potential repercussions of the United Kingdom's departure from the EU and its market of around 500 million people are still unclear.
For Gibraltar, border checks and market access are key issues in relations with the bloc.
Philip Valverde, a 62-year-old businessman, said after casting his ballot that "because of the Brexit situation I suppose everybody is a bit worried."
"We depend on that frontier (with Spain) being open," he said.
Gibraltar relies heavily on more than 15,000 workers — most of them European, making up half of Gibraltar's workforce — who every day cross the border from Spain, which is in the EU.
Throughout the Brexit talks, Spain has insisted it wants a say on the future of Gibraltar. The Rock was ceded to Britain in 1713 but Spain still claims sovereignty over it.
The territory still remembers how in 1969 Spanish dictator Gen. Francisco Franco slammed shut the border in an attempt to wreck Gibraltar's economy.
The international operations of Gibraltar-based online gambling companies, meanwhile, need access to the EU market. They account for some 25 percent of Gibraltar's economy, some 40 percent of its corporate tax revenue and about 3,000 jobs.
The Gibraltar Socialist Labour Party, in an alliance with the Gibraltar Liberal Party, is seeking a third consecutive term in government in Thursday's ballot.
"It has literally been my 'Hell on Earth' in politics," he wrote.
His party is proposing a major infrastructure plan, including land reclamation and the construction of affordable housing projects, to help keep the economy ticking over post-Brexit.
The Gibraltar Social Democrats, the main opposition, are offering tax cuts, a focus on tourism and the building of an industrial park, while reducing debt.
The recently formed Together Gibraltar promises to crack down on corruption and introduce a fairer tax system.
Election results are expected early Friday.
Hatton reported from Lisbon, Portugal.