The UN says pro-government forces and armed Islamist groups fighting for control of Libya's second city Benghazi have agreed to a 12-hour humanitarian truce.

The UN-brokered ceasefire, approved on Wednesday, was the first in Benghazi since the launch of a government-backed offensive to recapture the eastern city from fighters a month ago.

However, there were early signs that the truce was not being fully respected. AFP news agency reported heavy weapons fire in the city, although its origin was unknown.

Live Box 201462110622169518

The move was aimed at enabling the evacuation of civilians, the retrieval of bodies, the removal of sewage and the restocking of food and medical supplies, the UN mission in Libya said.

"The humanitarian truce is critical to giving the people of Benghazi a much-needed reprieve from violence," it said, urging all parties "to fully abide by their commitments during the truce."

It said the truce began at 7am local time (05:00 GMT) and could be prolonged subject to agreement by all sides.

More than 350 people have been killed since the launch of the government-backed offensive led by retired General Khalifa Haftar against  armed Islamist groups who took near total control of Benghazi in July.

Libyan authorities have struggled to assert control over powerful militias which toppled longtime leader Muammar Gaddafi in a 2011 revolt.

The internationally recognised government has been forced to take refuge in the country's far east to escape a coalition of groups which seized control of Tripoli at the end of August.

Source: Agencies