Updated

Fighting in Libya's capital between rival militias has put the lives of people trapped there in danger and exacerbated already alarming levels of humanitarian needs, especially at migrant detention centers there, an international aid group said on Friday.

The clashes in Tripoli which erupted earlier this week have endangered the lives of local residents and an estimated 8,000 refugees, asylum seekers and migrants, Doctors Without Borders, known by the French acronym MSF, said in a statement. The fighting, pitting armed groups from Tripoli against other ones from a town to the south, has killed some 30 people, including civilians, and wounded 96 others, said Widad Abu Niran, a spokesman for the Libyan Health Ministry in Tripoli, on Thursday.

Malek Mersit, a Libyan health official, said on Friday that armed groups continue to wage street battles, but aid groups have managed to secure some passages and relocate families to safer areas. Dozens have been evacuated but others have remained trapped amid the fighting, he added.

"We hear heavy explosions and gun fire," Mohamed Husken, a Tripoli resident, said. "We feel the ground quaking beneath us due to the bombing."

Libya's electric company said its power grids have been heavily damaged amid the violence adding to the suffering of Tripoli's residents who had already long complained of outages. The company's executive director, Ali Sassi, voiced fears that the ongoing fighting may further aggravate the existing crisis.

Libya slid into chaos after the 2011 uprising that overthrew and killed longtime ruler Moammar Gadhafi. The country is currently governed by rival authorities in Tripoli and the east, each backed by an array of militias that wield real power on the ground.

MSF said the latest violence in Tripoli shows that Libya "is not a safe place" for migrants, refugees and asylum seekers fleeing war-torn countries or suffering horrible conditions during their captivity by human traffickers or while arbitrarily held in detention centers.

"These people are already extremely vulnerable, and now they find themselves trapped in yet another conflict without the ability to escape," the head of MSF's Libya mission, Ibrahim Younis, said.

The United Nations refugee agency said on Thursday that some 300 migrants and refugees have been evacuated from a detention center near the violence to a safer one after they were found to be in "clear danger of getting caught in the hostilities."

MSF's statement said Libyan authorities, governments of safer countries and the U.N. "have all failed" to set up an effective mechanism to process asylum claims. It also criticized European countries for setting policies preventing asylum seekers from leaving Libya, which has emerged as a point of embarkation for migrants fleeing poverty and war in Africa and the Middle East to attempt the perilous trip to Europe.

On Thursday, Fayez al-Serraj, head of the Tripoli-based U.N.-backed government, assigned forces from Libya's western and central regions to push for a ceasefire between the rival militias. Western countries including France, Italy, the United Kingdom and the United States had earlier expressed concern over the clashes.