Tripoli (AFP) - The United Nations warned on Monday that the Libya conflict was preventing some 279,000 children from attending school across the war-torn country.

"Recently released data from Libya’s Ministry of Education paints an alarming picture of education access," the UN's Office for the Coordination of Humanitarian Affairs (OCHA) said.

"A total of 558 schools across various regions of Libya (were) classed as nonfunctional, affecting approximately 279,000 school-age children," OCHA said in a report.

Schools had closed "due to partial or complete damage as a result of conflict and fighting," it said.

In some cities including Libya's second city of Benghazi, "a number of schools have become shelters for the displaced, preventing children from accessing them," it added.

For more than two years, the eastern city has been rocked by fighting between forces loyal to the internationally-recognised parliament and armed groups including the jihadist Islamic State group.

The violence has forced most schools in Benghazi to close in mid-2014, with only about a third reopening in December last year.

To the west, the coastal city of Sirte has lost more than three quarters of its total population after IS overran it in June last year, OCHA said.

It said that since April and May, 35,000 people fled Sirte as forces loyal to Libya's UN-backed unity government launched an offensive to retake the city from the jihadists.

"Host communities are struggling to provide assistance" as increasingly more people flee Sirte, putting a burden on infrastructure,OCHA said.

"Water and sanitation conditions... are deteriorating rapidly and hospitals face shortages of beds and medical supplies to aid growing numbers of patients."

Rival militias in Libya have been vying for power since the overthrow of dictator Moamer Kadhafi in 2011.

The unity government -- the result of a UN-backed power-sharing agreement in December -- has been striving to assert its authority amid the chaos.