The United Nations has condemned the shelling of a hospital in Tripoli, calling it a "clear violation of international law" as Libya struggles to prepare for an outbreak of the new coronavirus.

On Monday, projectiles struck the grounds of the Al Khadra General Hospital located in an area held by the internationally recognised government near a front line, injuring at least six health workers.

More:

Jens Laerke, spokesman for the UN Office for the Coordination of Humanitarian Affairs (OCHA), told a news conference held via video link that the UN was "appalled" to learn of the shelling.

He read out a statement by Humanitarian Coordinator for Libya, Yacoub El Hillo.

"At a moment when people in Libya needed nothing more than a safe home and functioning medical facilities, we received the news of yet another attack on a hospital," the statement said.

"This is a clear violation of international humanitarian law ... It is unacceptable at a time when healthcare and health workers are vital in our fight against a global pandemic," said Laerke quoting El Hillo.

"A deplorable strike like this, resulting in senseless damage of a most needed medical facility, cannot be justified," said Laerke.

The local council of Abu Salim district said the hospital was hit by rockets fired by the eastern-based Libyan National Army (LNA) of renegade military commander Khalifa Haftar, which has been attempting to capture Tripoli since last April.

Abu Salim council posted photographs showing damaged cars in the hospital grounds.

Six wounded

Al Jazeera's Mahmoud Abdelwahed, reporting from Tripoli, said that six health workers were wounded in the attack.

"The hospital sustained substantial damage in the attack. Not only it is one of the largest hospitals in Tripoli, it is the only one dedicated to COVID-19 patients, who were recently transferred there," Abdelwahed said.

Libya's health infrastructure has been badly reduced by years of chaos and conflict since the 2011 uprising against strongman Muammar Gaddafi, and aid agencies have warned it is poorly prepared to withstand a major coronavirus outbreak.

Libya has confirmed 18 cases of the virus so far, but despite the pleas of the UN for a ceasefire, the conflict has escalated sharply over the past two weeks.