Libyan military strongman Khalifa Haftar on Wednesday announced the "total liberation" of second city Benghazi, which was overrun by jihadists three years ago.
"After a continuous struggle against terrorism and its agents that lasted more than three years... we announce to you the liberation of Benghazi from terrorism," Haftar, in full military regalia, said in a speech broadcast on television.
"Today Benghazi enters a new era of peace, security, reconciliation.... and reconstruction," said Haftar, paying homage to "a caravan of martyrs" who fell in the battle for the city.
Field Marshal Haftar declared war on jihadists in Benghazi, three years after the 2011 uprising that toppled and killed Libyan dictator Moamer Kadhafi.
Code-named Operation Dignity, the assault led by Haftar targeted several jihadists groups which had overrun Benghazi after the uprising.
These include the Revolutionary Shura Council of Benghazi, an alliance of Islamist militias among them suspected members of the Islamic state group and the Al-Qaeda-linked Ansar al-Sharia.
Haftar's announcement came only hours after the Libyan National Army said they had cornered the last jihadists in a neighbourhood of the eastern city, which had been the cradle of the uprising.
The LNA said they were surrounding the jihadists in Al-Sabri central district after routing them from the Soug al-Hout neighbourhood.
LNA General Abdessalam al-Hassi told AFP the jihadists were cornered in a small part of Al-Sabri and under attack from air strikes, as well as ground forces on three fronts.
Last week a medical source in the city said 44 LNA soldiers had been killed in June alone in Al-Sabri and Soug al-Hout.
Haftar does not recognise the authority of the UN-backed Government of National Accord in Tripoli and instead backs a rival parliament based in the country's far east.
In May, the Libyan foreign minister said Haftar must accept civilian rule in order to play a role in the future of the North African country.
"Haftar must first accept to work under a civilian authority and officially approve the political deal" that gave rise to the power-sharing authority, Mohamed al-Taher Siala told AFP.
Libya has been wracked by chaos since the 2011 uprising, with rival authorities and militias battling for control of the oil-rich country.