Spanish leader Mariano Rajoy described Gibraltar as an "anachronism" during his speech at the 68th General Assembly of the United Nations.
Rajoy also highlighted the fact that the tiny territory with some 30,000 inhabitants was on the 1963 UN list of Non-Self-Governing Territories that were awaiting decolonization.
"It is the only one (of its kind) in Europe, and is still affecting our territorial integrity," said Spain's prime minister before a sparsely populated room.
"This colonial anachronism continues to cause problems for the citizens of Gibraltar and the adjoining area," he said.
The Spanish leader's words come in the context of a heated dispute between Spain and the UK over fishing rights.
Britain accuses Spain of having imposed stringent border checks since late July in retaliation for Gibraltar placing concrete blocks in the sea to protect the waters from over-fishing.
Spain complains that the blocks threaten the livelihoods of Spanish fishermen and blames Gibraltar for an increase in tobacco smuggling to the Spanish mainland.
The spat has seen long queues forming at the border between Spain and Gibraltar in the wake of rigourous vehicle checks by Spanish authorities.
On Friday, Rajoy also told the UN that Britain had consistently ignored the Brussels Agreement of 1984.
This agreement was designed to guarantee the free movement of people, vehicles, and goods between Gibraltar and neighbouring territory in Spain.
It also aimed to set up a negotiating process so that Spain and the UK could settle differences over Gibraltar.
The agreement was criticized by Gibraltar as it's only representation was via the UK delegation.
On Wednesday, a UN monitoring team arrived at the Gibraltar–Spain border to monitor the situation.