The northeast Nigerian town that Boko Haram declared their headquarters has been retaken by government forces, the country's military said.
Gwoza in Borno state was initially seized by the Islamist group in July 2014, causing some 3,000 residents to flee the fighting.
Boko Haram leader Abubakar Shekau declared in August last year that Gwoza was "part of the Islamic caliphate," suggesting the group were imitating the Islamic State group.
But the government claims to have taken control of the town again following what Nigeria's national security spokesman Mike Omeri said was the "final onslaught" against Boko Haram.
Nigeria's defence department in Abuja said in a statement on Twitter: "Troops this morning captured Gwoza destroying the headquarters of the terrorist's self-styled Caliphate.
"Several terrorists died while many are captured. Mopping up of entire Gwoza and her suburbs is ongoing," it added.
Two weeks ago Boko Haram members had gathered en masse in the town in preparation for an expected showdown with international forces.
The group had urged civilians to leave the area to avoid being killed in crossfire during the anticipated battle, and the hostilities put a stop to national elections due to be held in February.
If confirmed, the retaking of Gwoza will be a major coup for the campaign of President Goodluck Jonathan for re-election in ballots that will now be held on Saturday.
In a televised broadcast, the President hailed troops for having "successfully stemmed the seizure of Nigerian territories".
"I heartily commend the very courageous men and women of our Armed Forces for the immense sacrifices which they continue to make in defending the nation and protecting its citizens," he said.
Safety has come at a heavy price for tens of thousands of Nigerians who have fled the insurgency and are sheltering in neighbouring Cameroon.
After Gwoza was recaptured, one man who said he was forced to join the militants, claimed the Boko Haram leader personally ordered women to be killed in the town.
"On Sunday March 15, Shekau assembled his men including us, the new recruits, and addressed us. He said they should go back to Gwoza and kill all of their women they left behind," Usman Ali said.
"He said if they didn't kill them they would not join them in paradise. They took us along to Gwoza where we witnessed the carnage."
A four-nation coalition of Nigeria, Niger, Chad and Cameroon has claimed a number of successes since the turn of the year to end the fighting which has claimed more than 13,000 lives since 2009.