Britain's foreign ministry said the oceanographic survey vessel accompanied by Spanish police boats made unlawful incursions on Wednesday and Friday into
waters off the British overseas territory on the southern tip of Spain.
"These incursions are a matter of deep concern. The British government will be raising this incident at a high level with the Spanish government," a British Foreign Office spokesperson said.
The spokesperson said that the Royal Navy monitored the Spanish boats and issued them with a warning during the incursion.
Tension flared between Spain and Britain in July when Gibraltar boats dumped blocks of concrete in disputed waters used by Spanish fishermen.
Gibraltar said it was creating an artificial reef that would boost fish populations.
Spain subsequently stepped up border checks, leading to huge queues for motorists, in what Britain and Gibraltar charged was a retaliatory measure aimed at a choking the territory's economy.
This week for the first time, queues also formed at the border for pedestrians to cross from Gibraltar into Spain as Spanish police intensified passport checks, an AFP reporter said.
Spain ceded Gibraltar to Britain in 1713 but has long argued that it should be returned to Spanish sovereignty. London says it will not do so against the wishes of Gibraltarians, who are staunchly pro-British.
Gibraltar's government added in a statement on Friday that it would start reporting such sea incursions by Spanish state vessels to the United Nations.