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 .