Gibraltar has fought off a Spanish attempt to remove it from the south-west of England region in voting for the European Parliament.
Gibraltar held its first European Parliament vote in 2004
The Rock was included with the South West region for the first time in 2004 EU elections.
Spain went to the European Court of Justice, claiming the move was illegal.
But the court rejected the Spanish claims, saying Britain had an obligation to extend voting rights to British citizens in Gibraltar.
The court in Luxembourg also rejected Spain's argument that the move to include Gibraltar was a violation of EU law by giving a vote to some non-EU citizens on Gibraltar.
It said it was up to the British government whether to give non-EU citizens a vote.
The eventual turnout was 57% among Gibraltar voters, compared with just 38% for the region as a whole.
Graham Watson, Liberal Democrat MEP in the South West, said: "It comes as a fitting conclusion to Gibraltar's National Day celebrations that the European Court of Justice has thrown out a spurious Spanish assault on Gibraltar's sovereignty."
Britain has held Gibraltar since 1704. Spain ceded sovereignty in 1713 but has repeated claims to the territory, which is at its southern tip.