Britain has joined world leaders in condemning military action in Libya amid concerns of another civil war.

Foreign ministers from the G7 group, which includes the UK, released a joint statement warning that fresh fighting in the country was “harming innocent people” and urged all parties to “immediately halt all military activity”.

It came as forces under Khalifa Hifter, leader of the self-styled Libya National Army based in the country’s east, clashed with pro-government militias in western Libya.

Hifter had declared an offensive to seize the capital of Tripoli, which is controlled by the internationally recognised Government of National Accord, and his forces were reported to be on the outskirts of the city late on Friday.

In their statement, the G7 foreign ministers said: “We urge all involved parties to immediately halt all military activity and movements toward Tripoli, which are hindering prospects for the UN-led political process, putting civilians in danger, and prolonging the suffering of the Libyan people.

“We firmly believe that there is no military solution to the Libyan conflict. 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 fighting has prompted fears of the worst escalation of violence since the 2011 civil war which led to the toppling and death of long-time ruler Muammar Gaddafi.

UN Secretary-General Antonio Guterres arrived in the country for his first visit as UN chief on Thursday, but tweeted a day later that he was leaving with a “heavy heart and deep concern”.

The UN Security Council held an emergency meeting late on Friday at Britain’s request.

The G7 group added: “We reiterate our full and united support to the United Nations Secretary-General Antonio Guterres and Special Representative of the Secretary-General Ghassan Salame as the UN seeks to help Libyans overcome Libya’s political stalemate, and help Libyans chart a path toward credible and peaceful elections as soon as possible, as agreed by the Libyan parties in Paris in May 2018 and in Palermo in November 2018.

“We further call on all Libyans to constructively support the UN-led process and the international community to demonstrate full unity and cohesion towards the shared objective of the sustainable stabilisation of Libya.”

Mr Hifter’s troops captured the town of Gharyan on Thursday, 31 miles south of Tripoli.

Groups allied with the government reportedly captured more than 100 of his soldiers as his forces pushed westward.