Updated

The U.N. mission in Libya says two local TV reporters detained by forces loyal to a commander who is on the offensive to capture the country's capital, Tripoli, have been released after three weeks in captivity.

Libya's Alahrar TV station said commander Khalifa Hifter's self-styled Libyan National Army detained two of its journalists, Mohamed al-Qarg and Mohamed al-Shibani, earlier this month.

The TV station, which backs the U.N.-supported government in Tripoli, said the journalists were released on Friday.

The U.N. said late Saturday that it welcomed their "safe return to their families" in the western city of Zintan.

Hifter's forces are locked in weeks-long fighting to take Tripoli against militias loosely allied with the U.N.-supported government. The fighting has reportedly killed at least 510 people, including combatants and civilians.