After years of stalling and halfhearted efforts under its now-ousted president, Yemen is finally showing resolve in the fight against al-Qaida's branch in the country, which has been behind a string of attempted attacks on the U.S., including a new foiled plot to bomb an airliner.

Still, the difficulties remain formidable.

The army is largely demoralized and undisciplined as it fights al-Qaida militants who seized several towns in the south during the chaos of last year's uprising against former President Ali Abdullah Saleh. The government's intelligence capabilities remain weak. Saleh loyalists seen as weak on battling the terror group remain in key military posts.

As a result, militants in the south have had a string of successes, including two bloody ambushes and attacks on army bases that have netted them thousands of weapons, Yemeni military officials say.

In a sign of the tougher stance, Saleh's successor, President Abed Rabbo Mansour Hadi, on Wednesday rejected an offer by al-Qaida for talks and vowed to arm popular militias to fight the terror network's militants alongside the army, according to a senior government official.

Culture Minister Abdullah Oubel told The Associated Press that the offer was relayed Wednesday by senior clerics and tribal elders acting as intermediaries. They told Hadi al-Qaida was prepared to talk if artillery shelling and airstrikes on their positions in the south are halted.

Hadi refused and gave al-Qaida 15 days to hand over weapons that its militants seized from army bases, according to Oubel.

The emissaries said they represented Ansar al-Shariah, the name taken by the militants who seized the southern areas. It is led by Qassim al-Rimi, who is the military commander for al-Qaida in the Arabian Peninsula, the terror network's branch in Yemen.

Hadi has also removed some former regime loyalists and intends to maneuver around those he cannot oust. Officials close to the president said Hadi intends to form a new force by taking counter-terrorism units away from the Republican Guards and Special Forces, which are led by Saleh's son Ahmed, and from the Central Security forces, commanded by Saleh's nephew Yahya.

The move would strip the two most powerful Saleh loyalists in the military from any say in the fight against al-Qaida and would give Hadi, a career army officer, control over how it is run, said the officials, who spoke on condition of anonymity to discuss the plans, still in the works.

The U.S., meanwhile, is gradually resuming the cooperation it once had with Saleh, which was suspended nearly a year ago during the popular uprising against Saleh's authoritarian rule.

On Tuesday, a Pentagon spokesman, Navy Capt. John Kirby, said "small numbers" of U.S. trainers have recently returned to Yemen. He would not be more specific about their number.

Yemen has been a source of serious concern to Washington because it was the launching pad for two foiled al-Qaida attacks on U.S. territory that were potentially disastrous: The Christmas 2009 attempt to down an American airliner over Detroit with an underwear bomb and the sending of printer cartridges packed with explosives to Chicago-area synagogues in 2010.

On Monday, The Associated Press disclosed that the CIA thwarted a plot by al-Qaida in the Arabian Peninsula to destroy a U.S.-bound airliner using a bomb described as an improvement on the 2009 underwear bomb because of the absence of metal which could have made it undetectable by conventional airport scanners.

The would-be bomber was actually a double-agent working for Saudi Arabia's security services. Saudi officials worked with the CIA to deliver the sophisticated new bomb directly to the U.S. government.

There was no indication that Yemeni officials were involved in the intelligence operation. Still, in recent months, U.S. officials have praised Hadi for showing an increased commitment and better cooperation in fighting al-Qaida.

Hadi succeeded Saleh in February under a U.S.-backed peace plan put forward by Yemen's Gulf Arab neighbors by which Saleh stepped down in return for immunity from prosecution.

Saleh, who ruled Yemen for some 33 years, was a key partner with the U.S., which poured in millions of dollars in aid and training to fight al-Qaida.

However, Saleh was seen as unreliable. He directed funds toward bolstering units led by family members and diehard loyalists. He often struck deals with Islamic militants, even releasing some from prison, as a tool to play his foes off against each other, and corruption in the military undermined the fight.

Hadi now faces dealing with Saleh's legacy.

Yemen is the Arab world's poorest nation, and its religiously conservative population is distrustful of the West, particularly the United States. There are increasing calls among Yemenis for an end to what they see as American meddling in domestic affairs.

Hadi has replaced some Saleh-era commanders in the fight against al-Qaida militants in the south who seized the provincial capital of Zinjibar and nearby towns. But lack of discipline and a reluctance by commanders to take the fight to al-Qaida have handed the army a series of humiliating defeats that have demoralized troops, said military officials, who spoke on condition of anonymity because they were not authorized to talk to the media.

In attacks on army bases over the past three months, al-Qaida militants have seized at least 50,000 firearms, including assault rifles, machine-guns and even tanks, armored vehicles and rockets, the officials said.

This week, militants used fishing boats for the first time to attack a base near Zinjibar by sea as well as land, killing more than 20 soldiers and capturing 25 more.

In March, militants launched a surprise pre-dawn attack on a base while troops slept, killing 185 troops and capturing 73.

"Lack of organization, even chaos, define the work of Yemen's military intelligence," said Mohammed al-Muqtiri, a security adviser to the government. "It is what the former president always wanted."

The military officials said al-Qaida has been able to recruit from among army officers in the south, according to a military intelligence official. Several of them have been arrested and confessed to providing information to al-Qaida of army movements in the south, said the official, who spoke on condition of anonymity because of the sensitivity of the subject.