A Chinese engineer was killed and a colleague was rescued Thursday when Pakistani commandos stormed a mud-walled compound in a remote tribal region near Afghanistan, killing five Muslim militants who had held the men hostage, authorities said.

The engineers were kidnapped in South Waziristan on Saturday by followers of Abdullah Mehsud, a one-legged former Taliban fighter who was freed from the U.S. detention facility at Guantanamo Bay, Cuba, in March. The two Chinese had been working on a dam project in the region.

Mehsud, who officials said was not with the kidnappers, initially demanded in satellite phone calls to Pakistani journalists that authorities free several foreign militants in exchange for the hostages. He subsequently demanded that the kidnappers and their hostages, who were surrounded by Pakistani security forces, be granted safe passage out of the area. Mehsud's whereabouts remained unknown Thursday night.

The standoff came to an end around midday, officials said, when commandos disguised as local tribesmen scaled the walls of the compound and opened fire on the kidnappers. Commanders gave the go-ahead for the operation moments after a delegation of tribal leaders made an unsuccessful final effort to persuade the kidnappers to turn over the men, the officials said.

Aftab Ahmad Khan Sherpao, Pakistan's interior minister, said there was "some confusion" as to whether the Chinese engineer who died in the assault was deliberately killed by his captors or caught in crossfire. He added, however, that "the Chinese government was fully on board in the decision to raid the terrorist hideout," located in Chagmalai, east of Wana.

The episode was the latest in an escalating series of clashes between Pakistani security forces and Muslim militants, many of them Central Asians with links to al Qaeda, who have used the remote tribal areas as a refuge since the ruling Taliban militia collapsed in Afghanistan in 2001.

Gen. Pervez Musharraf, Pakistan's president, was initially reluctant to move aggressively against the militants, who enjoy some support among the ethnic Pashtun population that straddles the Afghan border. But Musharraf, who seized power in a bloodless coup in 1999, has adopted a much tougher stance since Muslim militants twice tried to kill him last December by blowing up his motorcade.

Government forces have repeatedly clashed with the militants over the past six months, suffering significant losses but winning high praise from the Bush administration, which has largely looked the other way as Musharraf has backtracked on promises to restore democracy in Pakistan.

Musharraf last year pledged in a nationally televised address that he would step down as army chief of staff by the end of this year. But he has now reconsidered, citing national security concerns. On Thursday, the national assembly, dominated by pro-government lawmakers, passed a bill that would provide the Pakistani leader with legal cover for remaining in uniform.

After the rescue operation on Thursday, Pakistani military officials vowed to escalate their operations against militant strongholds and asserted that the kidnapping of the two Chinese engineers had stripped the foreign fighters and their local allies of popular sympathy. There was some evidence to support that view, even among Muslim politicians who have been deeply critical of the government's offensive in South Waziristan. "By kidnapping the Chinese citizens, Mehsud and his handful of supporters have lost all respect," said Maulana Mairajuddin Khan, a cleric and member of the national assembly from South Waziristan. "They have disgraced the movement against U.S. influence in the region."

Pakistan has long maintained close ties with China, which is lending assistance to several high-profile projects in the country. The two engineers worked for the Sino Hydro Corp., a state-run Chinese firm, and were kidnapped by three Uzbeks and two local tribesmen, Reuters news agency said, quoting a security source. Officials said after Thursday's operation that reports that the kidnappers had wired explosives to their bodies appeared to be untrue.

Mehsud, who is said to be in his late twenties, was captured by U.S. forces in Afghanistan in 2002, Pakistani officials said. He was repatriated from Guantanamo along with a number of other Pakistanis in March. While most remain in Pakistani custody, Mehsud was set free.

Lancaster reported from New Delhi.

Wang Ende, right, who was freed by Pakistani forces, is escorted by an unidentified Chinese Embassy official on Ende's arrival in Islamabad.Abdullah Mehsud, a former Taliban fighter and the kidnappers' leader, communicates with his followers.