Water supplies to the Libyan capital and surrounding cities have been restored two days after they were cut off when an armed group stormed a control room, averting shortages that could have caused a humanitarian crisis.

“The crisis of halting water supplies has ended and flows have started,” the Great Man-Made River company, a pipe network supplying ground water from the Sahara, said in a statement.

On Sunday, an armed group had stormed a pumping station run by the Great Man-Made River south of Tripoli, forcing employees to shut down water pipes connected to underground wells. The pipes supplied water to Tripoli, a city of more than 2 million people, and other coastal areas.

Forces loyal to the warlord Field Marshal Khalifa Haftar have been besieging Tripoli since 4 April in an attempt to take it from the UN-backed government of national accord (GNA). Their offensive, which has the tacit support of countries including the United Arab Emirates, Saudi Arabia and Egypt, is one of the most serious flare-ups in fighting since Muammar Gaddhafi was deposed in 2011.

The UN special envoy, Ghassan Salame, warned the UN Security Council that if the international community did not stop arms shipments to Libyan factions and demand an immediate ceasefire, it risked the partition of the country and further regional instability.

“I am no Cassandra, but the violence on the outskirts of Tripoli is just the start of a long and bloody war on the southern shores of the Mediterranean, imperilling the security of Libya’s immediate neighbours and the wider Mediterranean region.”

He warned many Libyans were starting to resign themselves to the possibility of a civil war lasting months or years and arms shipments to warring parties were feeding a proxy war. “Arms are pouring again to both sides,” he said.

The group who closed off the water supplies claimed to be supporters of Haftar the leader of the Libyan National Army (LNA), but the link has been disputed. There were claims the armed group was operating independently and that the GNA was making a link to undermine support for the controversial general.

It is generally accepted that the LNA’s plans for a quick victory and the defeat of the GNA have been thwarted.

The agency that oversees the water project, first commissioned by the former Libyan dictator Muammar Gaddafi, insisted it had never taken sides in the current civil strife and said water supplies should never be used to pursue any interest. “Water is God’s gift to all and should not be used to dictate or bargain under any conditions at all,” the authority said.

As a result of the attack, water was cut not just to Tripoli but also to Gharyan and some other western mountain cities. Supplies to residents were not immediately halted because the water system holds two days of capacity.

The incident underlined the vulnerability of Libya’s civil fabric to a prolonged war. The authority previously warned it was finding it difficult to repair leaks because of the fighting. Libya periodically suffers from water outages.

The GNA accused the armed group of seeking to “lock the water from the capital to lower the morale of its inhabitants”.

The episode may rebound badly on Haftar as he seeks to persuade the international community he can be the upholder of security against the criminal militias who have afflicted the weak GNA government in Tripoli. It will also add to the sense that the siege is deepening a general lawlessness in Libya that others, including Islamic State, are beginning to exploit. There have been a number of Isis hit-and-run attacks in the past month, mainly in the south of the country.

The east and west of Libya have been divided for much of the time since Gaddafi was ousted with the help of Nato-backed forces in 2011.

