Prime Minister Boris Johnson has said that the UK is “fully committed” to NATO, but warns that peace cannot be taken for granted.

Mr Johnson addressed a gathering of NATO members at a luxury hotel outside London to mark the 70th anniversary of the security alliance. He said: “Seventy years on, we are rock solid in our commitment to NATO and to the giant shield of solidarity that now protects 29 countries and nearly a billion people.

“The fact that we live in peace today demonstrates the power of the simple proposition at the heart of this alliance that for as long as we stand together, no one can hope to defeat us and therefore no one will start a war.

“This essential principle is enshrined in Article 5 of the North Atlantic Treaty — that if any one of us is attacked, all of us will go to their defence. If NATO has a motto, it is, ‘one for all, and all for one’.”

Mr Johnson went on to warn that “history shows that peace cannot be taken for granted” and “even as we celebrate this anniversary, we must ensure that our deeds match our words”. Reflecting on the terror attack on London Bridge last week, the prime minister said that “the atrocity in London last Friday shows why we must work together to combat terrorism and the vital importance of NATO’s missions to counter this threat”.

He added that NATO must adapt to handle new threats, saying: “We must never shy away from discussing new realities, particularly NATO’s response to emerging threats like hybrid warfare and disruptive technologies including space and cyber.”

The British prime minister made the comments as the Labour Party spokesman Barry Gardiner claimed that the alliance has been on the wrong side of history.

Speaking on BBC Radio 4’s Today programme, Mr Gardiner said that NATO had engaged in “phoney defence” and “aggressive militarism” and that a Jeremy Corbyn Labour government would de-escalate tensions with Russia.

The Labour spokesman’s remarks come two days after audio was unearthed from 2014 that revealed the party’s far-left leader Jeremy Corbyn saying he wished NATO did not exist.

In footage reported in The Sun, the socialist said: “I am no fan of NATO. Indeed, I wish NATO didn’t exist.

“I am no fan of Western military alliances. Indeed, I wish they didn’t exist.”

Corbyn continued that the defence alliance had been established “in order to promote a cold war with the Soviet Union”. He also said that it was “an engine for the delivery of oil to the oil companies and the main nations of this world”.