Boris Johnson and fellow G7 leaders condemned Russia’s actions in Ukraine as the summit in Germany drew to a close.
The Prime Minister said he did not think the war would lead to a wider conflict in Europe but warned that was what Vladimir Putin wanted.
The gathering of world leaders in Bavaria has been overshadowed by atrocities in Ukraine, including the missile strike on a packed shopping centre in Kremenchuk on Monday.
Mr Johnson said it was an act of “utter barbarism”
“People are just shocked by what Putin is capable of doing,” he said.
“If anything it helped those of us who are making the case for helping to protect Ukrainians to get that message across to some of those people who are the more swing votes in the argument.”
The head of the British Army, General Sir Patrick Sanders, has warned that Nato members have to be prepared to fight if their territory was attacked by Russia.
But speaking in Germany on the final day of the G7 summit, Mr Johnson said: “I don’t think it will come to that. Clearly we are working very hard to confine this to Ukraine.
“Putin and the Kremlin are going to try to widen the conflict and say that this is something to do between Nato and Russia – that is not it at all.
“This is about an invasion of an independent sovereign country. It is about the West and the friends of Ukraine giving them the support they need to protect themselves.”
The joint statement issued by the G7 at the conclusion of the summit in the Bavarian Alps promised continued tough sanctions, but drew back from imposing a price cap on exports of Russian oil – something Joe Biden’s White House had pushed for.
Instead the leaders agreed only to explore the measure.
The G7 leaders condemned “Russia’s illegal and unjustifiable war of aggression against Ukraine”.
The statement said: “We will stand with Ukraine for as long as it takes, providing the needed financial, humanitarian, military, and diplomatic support in its courageous defence of its sovereignty and territorial integrity.
“We are ready to reach arrangements together with interested countries and institutions and Ukraine on sustained security commitments to help Ukraine defend itself and to secure its free and democratic future.”
The leaders of the UK, US, Canada, Japan, Germany, France and Italy promised to “continue to impose severe and enduring costs on Russia to help bring an end to this war”.
“Beyond its direct implications, Russia’s aggression is impeding the global recovery and dramatically worsening energy security and access to food globally.
“To this end, we remain steadfast in our commitment to our unprecedented co-ordination on sanctions for as long as necessary, acting in unison at every stage, and will reduce Russia’s revenues, including from gold.”
They added: “We will take immediate action to secure energy supply and reduce price surges driven by extraordinary market conditions, including by exploring additional measures such as price caps.
“We reaffirm our commitment to phase out our dependency on Russian energy, without compromising on our climate and environmental goals.”
UK Government spokesman said: “Our own prohibitions on importing Russian oil are unchanged – this is about constraining the profits Russia can make from selling its oil to other countries while minimising negative economic impacts, especially on low and middle-income countries
“A cap would work by taking advantage of the power of the G7’s dominant maritime services that enable the transportation of Russian seaborne crude oil and petroleum products globally.
“Any company or country trying to export Russian oil above the cap would be unable to access these critical services and be severely restricted.
“The design of a cap will be carefully considered by the G7 over the coming weeks, consulting with other countries and key stakeholders in the private sector.”