DINARD, France (Reuters) - Foreign ministers from the G7 group of rich nations implicitly warned eastern Libyan commander Khalifa Haftar on Friday against an advance toward the capital Tripoli as they scrambled to defuse a dangerous escalation in the north African oil producer’s power struggle.

A military advance toward Tripoli and Libya’s U.N.-backed government by Haftar has taken the United Nations and Western powers by surprise, just as its secretary general was in the capital to plan a peace conference this month.

The news intruded on an annual meeting bringing together the top diplomats from Britain, Canada, Germany, Italy, France, Japan and the United States, who had been negotiating on norms to tackle cyber interference in democracies and sexual violence in Africa.

“We firmly believe that there is no military solution to the Libyan conflict,” the ministers said in a statement sent amid talks in western France.

“We strongly oppose any military action in Libya. Any Libyan actor or faction that precipitates further civil conflict are harming innocent people and standing in the way of the peace that Libyans deserve,” the statement said, without naming Haftar directly.

The ministers said they backed U.N. efforts just hours after Secretary-General Antonio Guterres departed Libya following a meeting with Haftar to try to avert civil war.

Concern over Libya’s stability is heightened by continuing political tensions around Europe over migration from north Africa, despite the fact that the numbers of new arrivals in Europe via the central Mediterranean have plummeted.

French Foreign Minister Jean-Yves Le Drian had earlier welcomed his counterparts from the club of big, rich nations under a dull gray sky in Brittany, for a meeting already overshadowed by U.S. Secretary of State Mike Pompeo’s absence and Britain’s Brexit meltdown.

French diplomats say Paris has scaled back its ambitions for France’s presidency of the club of major industrialized countries after U.S. President Donald Trump threw last year’s summit in Canada into disarray, backing out of a joint communique and firing barbs at Prime Minister Justin Trudeau.

A French diplomat sought to downplay Pompeo’s snub saying: “We’re working well with the Americans. Yes, we have differences on some subjects, but that isn’t holding back the quality of our dialogue.”

The ministers had aimed to agree on Friday on a code of conduct to tackle cyber interference in their democracies, but had turned their focus to Libya instead, diplomats said.

BREXIT LOOMS LARGE

Workers at dawn had furiously scrubbed away at graffiti spray-painted onto buildings near the secure zone in Dinard that attacked capitalism and President Emmanuel Macron.

Slideshow ( 8 images )

The slogans screamed “Thieving banks”, “Revolution” and “No to the G7”, mirroring the anger vented across France in five months of anti-government “yellow vest” protests fueled by perceptions of a growing rich-poor divide and aloof politicians.

The summit is expected to result in three joint statements on cyber security, sexual violence against women in armed conflict and trafficking in the Sahel region, and not too much wrangling over issues where there is less consensus such as Iran and Russia.

British Foreign Secretary Jeremy Hunt said he would use the summit to call on his European counterparts to support his government’s request for a short delay to Britain’s exit from the European Union.

Slideshow ( 8 images )

British Prime Minister Theresa May wrote to Brussels on Friday asking for a delay of Brexit until up to June 30, while saying she aims to get Britain out of the EU earlier to avoid it participating in European elections.

“What we are looking for is to avoid a long extension,” Hunt said. “We are a democracy with a hung parliament, so it’s not easy.”

Hunt said the G7 was proof Britain would not play a diminished international role after Brexit.