YOLA, Nigeria — A year ago, a dozen Nigerian troops fighting 200 Boko Haram militants in the town of Chibok exhausted their ammunition and ran, leaving the road open for the abduction of nearly 300 girls.

Today, Nigerian soldiers are rescuing hundreds of kidnapped girls and women from the last forest stronghold of the Islamic insurgents.

The reason for the unimaginably swift shift in fortunes?

In the last three months, military forces from neighboring Chad, Niger and Cameroon have joined the battle. In addition, Nigerian troops are finally getting better arms, as well as hazard pay that they had not received until this year.

As a result, Boko Haram’s supply lines are being cut off, creating conditions for the security forces to deliver a potential knockout blow to the extremists who have created havoc in northeastern Nigeria for years.

Nigeria’s military has announced that it has recaptured all major towns seized by the insurgents and that Boko Haram’s main fighting force is hemmed into the Sambisa Forest, where it is being pounded by air raids. While the government forces are stronger, Boko Haram is growing weaker by the day.

Women rescued in recent days from forest camps said that now it is the insurgents who are running out of ammunition, along with food and fuel. That could explain why the militants have stoned rather than shot some escaping captives.

Last year, Boko Haram fighters were able to escape across Nigeria’s borders to evade capture. Now, they are blocked by the troops from Chad, Niger and Cameroon. With Nigeria’s permission, Chad and Niger have even sent their forces inside Nigeria to pursue the extremists.

Routes used by Boko Haram to transport fuel and ammunition have been reclaimed by the military.

Last year’s toll of people killed by Boko Haram was estimated at 10,000 – more than in all the previous four years of the insurgency combined. The group carried out cross-border attacks with impunity, seized a swath of northeastern Nigeria and created a wave of 1.5 million refugees fleeing the self-declared Islamic caliphate.

President Goodluck Jonathan did not take a strong stand until this year – too late to save him from losing re-election in March as disgusted voters in Africa’s biggest democracy opted instead for Muhammadu Buhari, a former military dictator.

Jonathan also was slow to act when the group last year abducted the more than 200 schoolgirls in Chibok – initially denying it had even happened and losing precious weeks in the mass kidnapping that sparked worldwide outrage. It is still unclear if any of the Chibok girls are among the 700 freed from Boko Haram in the past week.

Buhari had crushed another Islamic uprising in the 1980s, and he has vowed “to rid this nation of terror” after he becomes president on May 29. A retired major general, he describes himself as a convert to democracy, and showed it by taking power through the ballot box.

Nigeria and its African partners say they want to eradicate Boko Haram. A more realistic goal may be to reduce it to what it used to be: a terror group with no control over territory.