Britain "will always stand up for Gibraltar" and its people, David Cameron has said.
The Prime Minister said the interests of the population of the British Overseas Territory "matters to us deeply" as he held talks with Fabian Picardo, its chief minister, at Downing Street.
The meeting to discuss the ongoing border dispute with Spain came as Spanish police unions organised a protest at the border over injuries reportedly inflicted on a Guardia Civil officer by a Gibraltar-registered car.
There have been reports of increasing violence at the border in recent days as angry commuters face long queues to get to homes in Andalusia.
Mr Cameron told Mr Picardo: "Britain will always stand up for Gibraltar. We will always stand up for the interests of the people who live in Gibraltar. It is something that matters to us very deeply."
Mr Picardo thanked him, saying: "The people of Gibraltar know they have a friend in David Cameron and a friend in William Hague. That Gibraltar continues to be on your mind means a lot to us."
Mr Picardo's visit to the UK also saw him meet with Foreign Secretary William Hague on Wednesday to discuss the row with Spain over an artificial reef built off the coast of the enclave.
The Spanish say the 74 concrete blocks on the seabed disrupt an area used by its fishing boats, while the Gibraltarians say it was a necessary environmental measure. The row, which started at the beginning of this month, has gone all the way to the European Commission and continued to simmer in recent days.
After the talks, a Number 10 spokeswoman said: "The meeting reaffirmed the existing strong and historic bonds between the UK and Gibraltar and the Prime Minister repeated his commitment to stand shoulder to shoulder with the people of Gibraltar.
"They discussed the unacceptable delays at the Spanish/Gibraltar border and agreed that these are damaging to the people and economies of Gibraltar and Spain. They agreed that efforts should remain concentrated on finding a diplomatic solution, in line with the Foreign Secretary's proposals last year for ad hoc dialogue."