Yemeni security forces drove al-Qaeda-linked fighters out of part of a southern city the militants have held for nearly four months, a military official said, in the first significant victory against the insurgents.

Months of ground battles and airstrikes have failed to shake the coastal city of Zinjibar and a nearby town out of the hands of Islamist militants who overran them in April and May.

The fighters, some suspected of links to Yemen’s al-Qaeda branch, swept into the area while President Ali Abdullah Saleh’s government had its attention focused elsewhere — on efforts to crush street demonstrations calling for the longtime leader’s ouster.

The government said in an official statement Saturday that it had retaken all of Zinjibar, the capital of Abyan province. But one military official said that only an eastern section was under government control and that fighting continued in other parts of the city late Saturday.

Some militants stole police vehicles and were seen fleeing Zinjibar for the city of Code, the official said, speaking on the condition of anonymity because he was not authorized to release information to journalists.

Saleh, who is recuperating in Saudi Arabia after a June attack on his compound in Yemen’s capital, Sanaa, said the United States and Saudi Arabia have supported the effort to retake Zinjibar and the town of Jaar from militants, and he thanked them. He did not elaborate.

A Yemeni Defense Ministry official said the United States had used drones and warplanes in attacks on Zinjibar and Jaar. He said the United States also had helped Yemen with reconnaissance flights over areas of Abyan province and provided information on fighters and their movements.

The United States has given Saleh’s government millions in aid to battle militants from al-Qaeda in the Arabian Peninsula, which Washington considers the terrorist network’s most dangerous and active branch.

The group has been linked to plots that include the failed attempt in December 2009 to blow up a Detroit-bound airliner with an explosive device sewn into the underwear of the would-be bomber.

Saleh has seized on those fears, warning the West that if he were to heed calls to step down, al-Qaeda would take control of the country. His political opponents have accused him of allowing the militants to take over Zinjibar and Jaar to stoke those fears.

Opposition spokesman Mohammed al-Sabri repeated those accusations Saturday. He said Saleh allowed the militants easy access to police headquarters where vehicles, ammunition and weapons were seized in June.

Sabri said Saleh wanted to sow chaos in five key provinces to deflect international calls for his resignation. He wanted Western allies, such as the United States, to choose between insecurity or his rule, Sabri said.

A former interior minister, Hussein Mohammed Arab, also accused Saleh of having a hand in the militant takeover. In a joint statement with the opposition, he said militants took over Zinjibar with no resistance after security forces withdrew without explanation.

There has been no official response to the allegations.

The militant takeover of Zinjibar forced more than 100,000 residents to flee, with many people seeking refuge in schools and apartments in the neighboring province of Aden.

— Associated Press