Top diplomats from the Group of Seven countries have agreed on the need for a coordination mechanism to help Ukraine repair and defend its critical energy and infrastructure from Russia's attacks, a senior State Department official said on Friday.

G7 countries gathered in the western German city of Muenster this week with Russia's Feb. 24 invasion of Ukraine, Iran's deepening military alignment with Moscow over the war as well as China's growing assertiveness topping the agenda.

The countries also discussed the state of the battlefield to figure out which weapons to provide to Kyiv, although this time the focus was more on assistance that would allow Ukraine to defend itself from the intensifying Russian attacks on its energy and water infrastructure, the official, speaking on the condition of anonymity, said.

"They discussed what needs Ukraine was facing as it heads into the winter and agreed that there needed to be a G7 coordinating mechanism to help Ukraine repair, restore and defend its critical energy and water infrastructure," the official told reporters.

"That's something that will be a core focus of this group in the days and weeks ahead," the official, speaking on the condition of anonymity, said.

Ukrainian Foreign Minister Dmytro Kuleba joined the G7 discussion virtually.

Over the past few weeks, Russia has launched waves of missile and drone strikes targeting Ukraine's energy infrastructure. Kyiv says they have damaged up to 40% of the power system and Ukrainian authorities warned that residents may face hours of blackouts due to the limited supplies.

The assistance that will allow Kyiv to defend itself against and respond to Russian attacks on civilian infrastructure included air defence systems, the official said.

"There was a decent amount of discussion of that, and what countries have the ability to provide the individual systems and support that might enable Ukraine to better defend itself against these UAV and missile attacks," the official said.

Moscow has acknowledged targeting energy infrastructure but denies targeting civilians in what it calls a "special military operation" in Ukraine to eliminate dangerous nationalists and protect Russian-speakers.

Ukraine and its Western allies have accused Iran of sending "kamikaze" drones, or unmanned aerial vehicles (UAVs), to Russia which have then been used to devastating effect by Russian forces in strikes targeting Ukrainian infrastructure as part of their Feb. 24 invasion of Ukraine. Iran denies the charge.

NATO has pledged to boost the protection of critical infrastructure after the ruptures in September in the Nord Stream 1 and Nord Stream 2 gas pipelines, laid on the bed of the Baltic Sea from Russia to Germany.

(Reporting by Humeyra Pamuk; Editing by Alex Richardson)