They said if Russia took such a step they would "take further action, individually and collectively".
The G7 leaders also said they would not recognise the results of a referendum in Crimea this weekend on whether to split from Ukraine and join Russia.
Separately, the US president said they "will be forced to apply costs" if Russia does not change course.
Barack Obama was speaking after holding talks with Ukraine's interim
Mr Yatsenyuk told reporters Ukraine "is and will be part of the Western world".
Earlier, Ukraine's national security chief Andriy Parubiy warned of a major Russian military build-up on Ukraine's borders.
He said Russian troops had not withdrawn since carrying out military exercises near Ukraine's eastern and southern frontiers last month, and were now "only two to three hours" from Kiev.
"In addition to its impact on the unity, sovereignty and territorial integrity of Ukraine, the annexation of Crimea could have grave implications for the legal order that protects the unity and sovereignty of all states," they said in a statement released by the White House.
They said Sunday's referendum, asking the people of Crimea if they want to be a part of Russia or Ukraine, has "no legal effect" as it is in "direct violation" of Ukraine's constitution.
"Given the lack of adequate preparation and the intimidating presence of Russian troops, it would also be a deeply flawed process which would have no moral force," they added.


Russia's military presence remains visible in the southern Ukrainian region of Crimea, where the majority of people are ethnic Russians.