The head of the self-styled Libyan National Army (LNA) has said his forces “liberated” the eastern Benghazi city after years of fighting with Islamists.
Field Marshal Khalifa Haftar said the city now enters a new era of “security, peace and reconciliation”.
If confirmed, victory would mark a major advance for the one-time commander in the army of late strongman Muammar Gaddafi.
The LNA is not recognised by Libya’s UN-backed government in Tripoli.
Libya’s unrest since the 2011 ousting of Gaddafi saw extremist organisations, including so-called Islamic State, gain a foothold in the country.
In a televised speech on Wednesday, Field Marshal Haftar said that “after a continuous struggle against terrorism and its agents that lasted more than three years… we announce to you the liberation of Benghazi”.
His announcement comes after bloody battles this week in Benghazi’s Sabri district in which dozens of LNA fighters and various local Islamist militants died.
Pictures posted on social media sites showed some civilians in Benghazi and other parts of the country celebrating the end of a bitter conflict that left large parts of the country’s second city in ruins and displaced thousands of people in recent years.
But Field Marshal Haftar also has many political and armed opponents in Libya.
He does not recognise the government in Tripoli, and instead backs the authorities in the east.
Opponents accuse the commander, who has backing from some foreign powers, of trying to impose autocratic rule in Libya.
BBC