Strategically important, Gibraltar was reluctantly ceded to Great Britain by Spain in the 1713 Treaty of Utrecht; the British garrison was formally declared a colony in 1830. In a referendum held in 1967, Gibraltarians voted overwhelmingly to remain a British dependency. The subsequent granting of autonomy in 1969 by the UK led to Spain closing the border and severing all communication links. A series of talks were held by the UK and Spain between 1997 and 2002 on establishing temporary joint sovereignty over Gibraltar. In response to these talks, the Gibraltar Government called a referendum in late 2002 in which the majority of citizens voted overwhelmingly against any sharing of sovereignty with Spain. Since late 2004, tripartite talks among Spain, the UK, and Gibraltar have been held with the aim of cooperatively resolving problems that affect the local population, and work continues on cooperation agreements in areas such as taxation and financial services; communications and maritime security; policy, legal and customs services; environmental protection; and education and visa services. Throughout 2009, a dispute over Gibraltar's claim to territorial waters extending out three miles gave rise to periodic non-violent maritime confrontations between Spanish and UK naval patrols. A new noncolonial constitution came into effect in 2007, and the European Court of First Instance recognized Gibraltar's right to regulate its own tax regime in December 2008, but the UK retains responsibility for defense, foreign relations, internal security, and financial stability.