Updated

Beefed up by new weapons from China, Russia and the Czech Republic, and strengthened by training from foreign advisers, Nigeria's military is forcing Boko Haram extremists from a string of northeastern towns as the country's prepares for elections the insurgents are threatening to disrupt.

The military offensive caused a six-week postponement of critical presidential elections now being held Saturday, a delay that should allow voting by some of the more than 1.5 million people forced from their homes by the Islamic uprising. But many refugees are reluctant to return home, doubting whether Nigeria's military can maintain control over territory it recaptured from the insurgents.

In just two months, Nigeria's military with help from troops from Chad, Niger and Cameroon has reclaimed about 30 towns and "liberated" the northeastern states of Adamawa and Yobe, leaving only 3 of 27 local government areas in Borno state under the sway of Boko Haram, according to the government spokesman on the insurgency, Mike Omeri.

Even so, there are no plans to set up polling stations in newly recaptured areas, said local electoral commission spokeswoman Rifkatu Duku in Yola, capital of Adamawa state.

"We are not going to risk the lives of our staff," she said. "Preparations are in top gear for the elections" at scores of temporary polling stations set up by the commission in Yola, a city of 300,000 people that now holds as many refugees.

For months Nigerian troops had been on the retreat, fleeing Boko Haram attacks as the insurgents seized territory the size of Belgium and declared an Islamic caliphate on the lines of the Islamic State group to which it recently pledged allegiance. Troops were being sent into battle with just 30 rounds of ammunition, often fleeing because they ran out of bullets, according to John Campbell, a former U.S. ambassador to Nigeria now with the Council on Foreign Relations.

Omeri attributed the new successes to the acquisition of arms after many difficulties.

"What we never had, we now have ... We have troops, we have aircraft, we have APCs (armored personnel carriers) and so on, and we are getting to where we should be to rebuild the armed forces, returning it to its glory," Omeri said Wednesday in an interview with The Associated Press.

The United States had stopped Israel from selling Nigeria helicopter gunships (probably because of the law forbidding sales to coutnries whose military are accused of human rights abuses but could also be because, as they said, Nigerian military didn't have the capability to operate them); some $20 million sent to South Africa to procure helicopters and other arms was blocked by the South Africa government as a bid to illegally procure arms; and the United States itself had refused to sell Nigeria helicopters, saying the Nigerian military was not trained to operate them.

And that proved to be the case when some equipment finally was procured, forcing Nigeria to hire foreigners, according to an analyst who is close to Nigeria's military establishment. He spoke on condition of anonymity because of the sensitivity of the issue. After a South African was killed last month in northeast Nigeria, reportedly by friendly fire, Nigeria acknowledged there were foreign "technical advisers" in the country.

Nigeria's military had not had a major arms replenishment since 1983, according to analysts and diplomats familiar with the matter. The Air Force was almost dismantled after a 1986 counter-coup attempt. Since decades of military dictatorship ended in 1999, governments kept the military weak to ensure there would be no more coups.

The emergence of Boko Haram exposed the weaknesses of what was once the most powerful military in sub-Saharan Africa. When Nigerian troops arrived to join an African-led force fighting Islamic extremists in Mali in 2007, some lacked guns and boots, according to an article titled "Army Rot at the Core" published in the latest edition of Africa in Fact magazine.

This year there have been reports of helicopters and drones arriving from China, armored infantry fighting vehicles, tanks and rocket launchers from Czech Republic, and other armaments from Russia.

At a news conference on Thursday, presidential candidate Muhammadu Buhari, a former military dictator, said he was worried the government might use the military for purposes "which put their political neutrality and credibility at risk."

Despite the military muscle, many of those who fled Boko Haram attacks are reluctant to return home.

"The military were on ground when Boko Haram came and took over our town. The same military has recaptured our land now, but we aren't sure that the insurgents won't come back," said Zira Yohanna, an elderly man at a refugee camp in Yola.

Two towns already have changed hands twice, signaling the Nigerian troops may not be able to hold on to newly seized territory.

Only refugees displaced within their own state will be able to vote. Thousands of others who have moved across state lines cannot vote, along with hundreds of thousands of refugees who have fled across Nigeria's borders.

Analysts say the election is expected to be extremely close between front-runners President Goodluck Jonathan, a Christian from the mainly Christian south who's party has governed since 1999, and Buhari, a Muslim from the predominantly Muslim north.

---

Associated Press writer Ibrahim Abdulaziz contributed to this report from Yola, Nigeria.