The United Nations’ mission in Libya says rival armed groups in Tripoli have reached a ceasefire agreement to end heavy fighting that has rocked the capital for more than a week.

The announcement on Tuesday came after Libyan authorities said that the death toll from the violence had risen to at least 61. Scores of people were also wounded.

“Under the auspices of [UN envoy Ghassan Salame], a ceasefire agreement was reached and signed today to end all hostilities, protect civilians, safeguard public and private property and reopen Mitiga airport in Tripoli,” the United Nations Support Mission in Libya (UNSMIL) mission said.

Fierce battles broke out in Tripoli’s southern districts on August 27 after the Seventh Brigade, an armed group based in Tarhouna, 65km southeast of the capital, launched a surprise offensive against rival militias.

A UN-backed truce was reached the next day but clashes resumed shortly after, forcing authorities to close Tripoli’s only functioning airport.

The violence prompted the UN-backed Government of National Accord (GNA) in Tripoli to declare a state of emergency on Sunday.

Earlier on Tuesday, Al Jazeera’s Mahmoud Abdelwahed reported from Tripoli that the situation remained tense, with sporadic fighting and indiscriminate rocket fire hitting residential areas.