Downing Street said the British position on the issue “has been quite clear” and the Foreign Office (FCO) said it was aware of Mr Rajoy’s comments.
The Spanish PM’s intervention came two days after a phone call with David Cameron, who told his counterpart the situation at the border with Gibraltar was “not acceptable”.
Number 10 said that in the “constructive” phone call on Wednesday Mr Rajoy agreed to reduce measures at the border which have led to lengthy delays for Gibraltarians, but a statement issued by the Spanish government afterwards made no reference to any such concession and insisted procedures at the frontier were proportionate.
Speaking after the call, the Prime Minister said he was very clear that Britain “will always stand up for the people of Gibraltar”.
His intervention followed a formal protest by Britain’s ambassador in Madrid over “disproportionate” checks at the border and Spanish threats to levy a charge on vehicles crossing the border and to close airspace.
The dispute has flared up over allegations of damage to fishing grounds caused by Gibraltarian authorities following the creation of an artificial reef.
Gibraltar’s chief minister, Fabian Picardo, has likened the Spanish behaviour to something from the Franco era or the regime in North Korea.
The European Commission has suggested organising a “technical meeting” with the Spanish authorities about the border controls in September or October.
A Commission spokesman said that because Gibraltar, like the UK, was not part of the Schengen open borders area in Europe “checks on persons can be carried out at its border with Spain” but that controls must be proportionate.
The Ministry of Defence (MoD) announced on Thursday that a British warship will visit Gibraltar later this month.
HMS Westminster and two support ships will visit Gibraltar while other elements of a task force will visit Spanish ports as part of training exercises known as Cougar 13.
The MoD said the deployment was “long-planned’’ and not connected to the political tensions in the region.
Cougar 13 is an annual exercise designed to hone skills and the deployment will also see port visits in Portugal and throughout the Mediterranean to Spain, Turkey and Malta before going to the Middle East.