The humanitarian situation has greatly deteriorated in and around the Libyan capital Tripoli, where “densely populated residential areas are gradually turning into battlefields”, the International Committee of the Red Cross (ICRC) has said.

Hospitals are struggling with chronic shortages of medical supplies amid power outages and weakened water pumping stations, the aid agency said on Thursday, after three weeks of clashes around the capital between renegade military commander Khalifa Haftar‘s eastern forces and troops loyal to the UN-recognised Government of National Accord (GNA).

“More than 30,000 people are said to have fled their homes and are sheltering with relatives or in public buildings,” it said, a figure which the United Nations said has risen to 36,000.

“It is crucial that hospitals, medical facilities, health staff and vehicles transporting the wounded are allowed to carry out their activities safely,” the ICRC said.

Rabab Al-Rifai, ICRC’s spokeswoman in neighbouring Tunisia, told Al Jazeera that the healthcare infrastructure has been deteriorating over the last eight years due to the unrest.

“Further prolonged conflict could bring it to its knees, in a country where there is already a shortage of medicine, and have a serious effect on people,” she said.

“We remind the parties in the conflict that the damages should be minimised in the densely populated areas, civilians should be protected, their properties and essential infrastructure should be protected.”

Al-Rifai urged the warring sides to guarantee safe passage to the civilians who want to leave the conflict area and to give them access to the humanitarian assistance.

The World Health Organization (WHO) said on Twitter that 278 people have been killed in the last three weeks, while 1,332 others have been wounded.

Tripoli’s southern suburbs and nearby villages have been heavily fought over and shelled, with territory regularly changing hands.

Haftar’s Libyan National Army (LNA), which is allied to a rival government in eastern Libya, has mounted an offensive on Tripoli but has so far failed to breach the city’s southern defences.

Today WHO deployed two general surgeons and one vascular surgeon to another hospital near #Tripoli. WHO's emergency medical teams are helping #Libya's frontline hospitals cope with the influx of wounded, who now number 1332. The death toll is 278. @OCHA_Libya — World Health Organization in Libya (@WHOLIBYA) April 24, 2019

Al Jazeera’s Mahmoud Abdelwahed, reporting from Tripoli, said that the GNA forces were advancing towards Asbiah area, about 45km south from the capital, on Thursday.

“If they take control of that area, they can cut the supply route for Haftar’s forces coming from the city of Tarhunah. Tarhunah and Garyan cities are major support cities for Haftar’s forces in the west of Libya,” he said.

“Also military sources with the government say that they have switched from their defence strategy to the attack strategy. They say that they are retaking control of several cities captured by Haftar’s forces over the past two weeks.”

On Wednesday, the United Nations refugee agency (UNHCR) evacuated 325 refugees from a detention centre on the southern outskirts of Tripoli.

UNHCR said in a statement on Wednesday those rescued from the Qasr bin Ghashir centre were transported to another detention facility in Az-Zawiyah, northwestern Libya, where they were “at reduced risk of being caught up” in ongoing fighting.

People running from clashes

About 3,000 refugees and migrants remain trapped in detention centres in Tripoli, according to the UN, and remain at risk from the “deteriorating security situation” around the capital. Many of the detainees fled war and persecution in their home countries.

190424200149291

Tripoli’s southern outskirts have been engulfed by fighting since the LNA launched an offensive on April 4 aimed at wresting control of the capital from the GNA, which is supported by an array of local militias.

The showdown threatens to further destabilise war-wracked Libya, which splintered into a patchwork of rival power bases following the NATO-backed overthrow of former leader Muammar Gaddafi in 2011 and has been split into rival eastern and western administrations since 2014.

Both the LNA and GNA have repeatedly carried out air raids against one another and accuse each other’s forces of targeting civilians.