DERA ISMAIL KHAN, Pakistan -- In an embarrassing battlefield defeat for Pakistan's army, Islamic extremists attacked and seized a small fort near the Afghan border, leaving at least 27 soldiers dead or missing.
The militants did not gain significant ground, but they did further erode confidence in the U.S.-allied government's ability to control the frontier where the Taliban and al-Qaida flourish.
Attacks on security forces are rising in the volatile tribal region, and Pakistan is reeling from a series of suicide attacks that killed former prime minister Benazir Bhutto and hundreds more, chipping away at President Pervez Musharraf's prestige before Feb. 18 parliamentary elections.
"The militants are now challenging the army openly. They have become very bold and are consolidating their positions," Talat Masood, a political analyst and retired general said after Tuesday night's attack on Sararogha Fort.
The insurgents who seized the post were said to be followers of Baitullah Mehsud, an Islamic hard-liner who since December has been sole leader of an umbrella group of Taliban sympathizers and who is also thought to have links to al-Qaida.
Musharraf has blamed Mehsud's movement, Tehrik-e-Taliban, for 19 suicide attacks that killed more than 450 people over the last three months. Mehsud, labeled enemy No. 1 by the government, also masterminded the brazen capture of 213 Pakistani soldiers last August.
Fighters of the pro-Taliban groups he leads have terrorized Pakistan's northwest, killing hundreds of soldiers, hunting down politicians, beheading women and burning schools that teach girls anything more than religion.
In the latest battle, insurgents launched a surprise attack on Sararogha Fort in South Waziristan and chased off its small garrison from the Frontier Constabulary, a paramilitary force formed of men from the area.
"About 200 militants charged the fort from four sides," the army spokesman, Maj. Gen. Athar Abbas, said. "They broke through the fort's wall with rockets."
Fifteen of the 42 soldiers manning the fort reached safety in Jandola, an army base about 10 miles south of the British colonial-era fort. Seven others were known dead and 20 were missing, Abbas said.
The military claimed the defenders killed 50 militants before being overwhelmed. A spokesman for Tehrik-i-Taliban said that only two of its fighters died and that 16 soldiers were killed and 24 others captured, half of them wounded.
There was no way to verify casualty numbers. Both sides have long accused each other of exaggerating such figures.
The Tehrik-i-Taliban spokesman, Maulvi Muhammad Umer, warned the government to release Taliban prisoners and stop military operations in the frontier region or face militant attacks across Pakistan.
"Attacks will continue not only in the tribal areas, but we will target the government everywhere in the country," he told The Associated Press by telephone.
He said militants had destroyed the fort with explosives.
Sararogha Fort is one of four such posts in the Mehsud tribal region, where Baitullah Mehsud is based and has thousands of armed supporters.
On Sunday, the military said its troops repelled a similar attack last week on another fort, at Lhada, and killed 40 to 50 insurgents. On Monday, militants ambushed an army convoy in the same area, touching off a firefight that the military said killed 30 insurgents and Tehrik-i-Taliban said resulted only in some of its fighters being wounded.
Musharraf first deployed the army in Pakistan's semiautonomous tribal regions along the frontier in late 2001 to chase down al-Qaida militants fleeing the U.S.-led invasion of Afghanistan.
Nearly 100,000 soldiers are now in the area, supported by heavy artillery and Cobra helicopter gunships, but they have had little success in stopping militants from infiltrating into Afghanistan or in quelling Pakistan's own worsening Islamic insurgency.
Government tactics have vacillated between use of extreme force and appeasement. Pro-Taliban forces now appear capable of launching the kind of coordinated assaults inside Pakistan's border regions as they do in the volatile south and east of Afghanistan.
A U.S. intelligence estimate last year said a Musharraf peace pact in 2006 with Taliban militants had allowed al-Qaida to regroup in Pakistan's tribal belt, a possible hiding place of Osama bin Laden and his top deputy, Ayman al-Zawahri.
Masood, the political analyst, said tribesmen were increasingly joining up with Taliban forces from across the border in Afghanistan.
"Even if they don't support the Taliban per se, they are now siding with them rather than the government because they think Musharraf and the army are an extension of the Americans," he said.
Washington considers Musharraf a key ally in the fight against extremist groups. President Bush and other U.S. officials have frequently praised Musharraf, who seized power in a 1999 coup but resigned from the army in December and is now ruling as a civilian president.
After the fall of Sararogha Fort, opposition leaders were quick to blame Musharraf for the deteriorating security situation.
"Musharraf is the root cause of all problems," said Nawaz Sharif, a leading opposition politician and the prime minister who was ousted by Musharraf in 1999.
"If he goes, 95 percent of the problems of this country will be solved. There will be no bomb blasts, there will be no missile attacks," Sharif told reporters in his hometown of Lahore.
Associated Press writer Riaz Khan in Peshawar contributed to this report.