TUNIS (Reuters) - Hundreds of migrants have been abandoned without food or water in government-run detention centers in the Libyan capital after guards fled from clashes between rival armed groups in the past few days, aid workers said on Wednesday.

Tripoli has been shaken since the weekend by fighting between rival groups vying for power and state funds, a recurring theme in the North African country since the messy overthrow of Muammar Gaddafi in a 2011 NATO-backed uprising.

Some 400 people were abandoned in the Ain Zara detention center run by the U.N.-backed government, one aid worker said, asking not to be identified.

Ain Zara in southern Tripoli is part of a network of state facilities where Libya holds migrants intercepted by the coastguard while trying to reach Italy by boat with the help of human traffickers.

“There are about 400 people locked in the Ain Zara detention center, among them 200 men and 200 women and 20 children under five years without food and water,” the aid worker said. “The guards of the center have fled due the current clashes in the city.”

A source at an international organization said some 1,500 migrants had been originally trapped in three detention centers. Some had escaped, while others had been transferred to detention centers in safer areas.

Libya is the main departure point in North Africa for migrants crossing the Mediterranean to Europe, mainly from other parts of Africa. The numbers have fallen since Italy provided the coast guard with more boats and brokered deals with local groups in a smuggler hub last year.

There was no immediate comment from the internationally recognized Government of National Accord (GNA) which formally is in charge of Libya but in reality is not even in full control of the capital.

Residents said there was more fighting going on in several parts of Tripoli on Wednesday, including in the area of Tripoli International Airport, which has been closed since 2014 by fighting between militia groups.

Tripoli’s big armed groups claim to have official status through the GNA, but act with autonomy. A rival government is based in the east.