China and Iran were also on the agenda at the G7 meeting, but much of the meeting concentrated on the growing crisis on Europe's eastern fringe.
“We call on Russia to de-escalate, pursue diplomatic channels, and abide by its international commitments on transparency of military activities,” the G7 read.
“Any use of force to change borders is strictly prohibited under international law. Russia should be in no doubt that further military aggression against Ukraine would have massive consequences and severe cost in response.”
British Foreign Secretary Liz Truss, US Secretary of State Antony Blinken, EU officials and the foreign ministers of France, Italy, Germany, Japan and Canada met in the northern English city of Liverpool.
“We've sent a powerful signal to our adversaries and our allies,” Ms Truss said.
“We've been clear that any incursion by Russia into Ukraine would have massive consequences for which there would be a severe cost.
“We've also shown that we stand for freedom and democracy and the rights of people everywhere to live free from oppression.
“We need to make the positive case for individual humanity and dignity, which lies at the heart of our democratic free societies.”
Russia has already annexed Crimea, part of Ukraine, and tension is rising again with Russia massing thousands of troops on the border with its neighbour.
“We reaffirm our unwavering commitment to Ukraine’s sovereignty and territorial integrity, as well as the right of any sovereign state to determine its own future,” the G7 said in a statement. “We commend Ukraine’s posture of restraint.”
A senior US State Department official described talks as “intense” and said there was still a diplomatic path to de-escalate the tensions with Russia.
The meeting comes as the West also has concerns about China's military and economic ambitions and the possibility that talks to prevent Iran from pursuing a path to nuclear weapons could fail.
On China, Ms Truss said the G7 was concerned at what it called China's “coercive economic policies”.
“We discussed a range of issues and challenges, such as the situations in Hong Kong and Xinjiang, in the East and South China Seas and the importance of peace and stability across the Taiwan Strait,” she said.
“We also expressed our concern about coercive economic policies.”
She said Iran needed to resolve the international dispute over its return to the nuclear deal with world powers.
“This is the last chance for Iran to come to the negotiating table with a serious resolution to this issue,,” she said.
The final communique from the talks said Iran “must stop its nuclear escalation and seize the opportunity to conclude a deal, while this is still possible".
The G7 meeting is the first international gathering for Germany’s new foreign minister, Annalena Baerbock