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.
Divided opinion - by Rana Jawad, BBC North Africa correspondent
Benghazi's conflict over the last three years at times appeared to have no end in sight, and - as it grew - so too did the Field Marshal Haftar's political and military ambitions.
This is a significant gain for him, and a city that has been aching for respite from the war.
Opinions over the conflict in Benghazi are largely divided; many will be celebrating what they see as a war brought to their doorstep by Islamist militias at a time when political actors in Libya barely acknowledged there was a problem there, despite the near daily bombings and killings in the city.
Others view it as a product of a man who was power-hungry and lumped up all of his enemies under the banner of "Islamist terrorists" to pave the way for a future political role through the might of the gun.
His short address dedicated to the people of Libya had an unusually reconciliatory tone, but it is not one that will ease worries over what his, or his opponents' next move might be.
In Libya today, a military victory in one battlefield often opens the door to conflict in others.