The trip to Gibraltar to attend a Stronger In rally was called off after Jo Cox, the Labour MP for Batley and Spen was shot in West Yorkshire.
The Prime Minister had just touched down in Gibraltar but immediately announced that the rally - and all Remain campaigning - would be cancelled.
Photo: Jo Cox, MP
She was reported to be in a "critical condtion" after being shot and stabbed several times and was airlifted to hospital.
It's right that all campaigning has been stopped after the terrible attack on Jo Cox. I won't go ahead with tonight's rally in Gibraltar.— David Cameron (@David_Cameron) June 16, 2016
Spanish Prime Minister Mariano Rajoy also tweeted about the attack, writing: “I condemn the attack on the British MP Jo Cox. Violence has no place in democracy. I wish her a swift recovery. MR.”
Condeno la terrible agresión sufrida por la diputada británica Jo Cox. La violencia no tiene cabida en democracia. Deseo su recuperación. MR— Mariano Rajoy Brey (@marianorajoy) June 16, 2016
Cameron was due to speak at a rally in the British Overseas Territory to campaign for a Remain vote in the EU referendum, in what was to be the first visit by a UK Prime Minister to the Rock since 1968.
The surprise visit was announced late on Wednesday but provoked a swift reaction from the Spanish government.
The government issued an official communique over the visit expressing its displeasure, while the acting Prime Minister warned that Gibraltar was rightfully Spanish whatever the outcome of the EU referendum.
Speaking on the radio, Mariano Rajoy said: "The government does not like the fact that Mr Cameron is travelling to Gibraltar. The debate is about whether the UK remains within the EU or not. It should therefore happen in the UK and not Gibraltar".
Crowds had already gathered in Casemates Square where the rally was to be held when news came through that it had been cancelled.
Peter Canessa informs crowds gathering on Casemates the.reasons why the rally is cancelled. pic.twitter.com/E72Yn8u7KS— Gibraltar Chronicle (@GibChronicle) June 16, 2016