Updated

The feverish final hunt for suspected Sept. 11 mastermind Khalid Shaikh Mohammed began last month with a narrow escape in the rambling frontier city of Quetta. It ended — thanks to interrogations and intercepted messages — with a lightning raid near the capital.

The arrest of the No. 3 man in Usama bin Laden's network was the result of deep cooperation between CIA and Pakistani intelligence, officials say. Pakistani Ahmed Abdul Qadus and an unidentified man of Middle Eastern origin were also arrested early Saturday in Rawalpindi, a bustling city near the capital.

A senior government official told The Associated Press that Mohammed and the other foreigner were whisked out of the country and turned over to U.S. custody. Qadus is being questioned here. A photograph obtained by AP shows Mohammed shortly after his arrest, wearing a white T-shirt and his hair disheveled. His traditional beard is gone, replaced by a small mustache.

Security officials said the pursuit for Mohammed heated up after authorities arrested an Egyptian man in the frontier city of Quetta on Feb. 14. Authorities had hoped to find the top Al Qaeda figure, but he was not there.

"At the time of that raid in Quetta the authorities were looking for Khalid Shaikh but he escaped and from there they followed him to Rawalpindi," the senior government official said. "They got information from the man they picked up in Quetta and from phone calls until they tracked him down to Rawalpindi."

A top police official in Quetta said the arrested suspect changed his story many times during questioning, but finally identified himself as Abdul Rehman, from Egypt. The official said police were aware that another suspect got away, but were not told of his significance. The police later handed Rehman over to Pakistan's intelligence agency, known as ISI.

"We got some information about two foreigners who were in the neighborhood. When we went there we found only one," the official said. "Rehman admitted there was someone else with him, but he never said anything about Khalid Shaikh Mohammed."

The second suspect arrested in Rawalpindi with Mohammed has not been named, but the senior government official said he was "also proving to be an important man."

Mohammed, 37, is perhaps the most senior Al Qaeda member after bin Laden and his deputy, Ayman al-Zawahri. He allegedly organized the Sept. 11 terror attacks, and was linked to a 1995 plot to bomb trans-Pacific airliners and crash a plane into CIA headquarters. He also has been tied to the April bombing of a synagogue in Tunisia, which killed 19 people, mostly German tourists.

A Pakistani intelligence official with knowledge of the case said American communications experts helped Pakistani authorities trace an e-mail the arrested Quetta suspect sent to Qadus. They immediately put Qadus under surveillance, which led authorities to Mohammed, the official said.

U.S. officials said the operation in which Mohammed was captured was carried out jointly by the CIA and Pakistani officers.

On Sunday, Qadus' family vehemently denied he was involved in terrorism and insisted he was alone at home with his wife and children when authorities burst in around 3 a.m. Saturday.

They said about 25 heavily armed agents, some in civilian clothes and some in blue uniforms, stormed into the house, rifling through drawers and pointing their guns at the children. They quickly took Qadus away and kept his wife and children under guard in a small bedroom as they searched the house, Qadus' sister, Qudsia Khanum, said.

Agents, all of whom appeared to be Pakistani, took a computer hard-drive, documents and U.S. dollars from the house, the family and security officials said. Khanum said the computer had no Internet hookup and that her brother didn't even know how to use it.

"He is slow, and he is so innocent and friendly, it is inconceivable that he could be involved in intrigue. People run rings around him because it would never occur to him that they might lie or take advantage of him," she said from the family's living room in an upscale neighborhood of the city.

Qadus' father, Abdul Qadus, is a prominent microbiologist who worked in Africa for the World Health Organization for many years before retiring, Khanum said. The 42-year-old Qadus, however, could not hold down a job and had lived at home with his parents his entire life, she said.

Qadus' mother, Mahlaqa, is a local leader of Jamaat-e-Islami, one of the main hardline religious parties in Pakistan. The family speculated the arrest was a political ploy to discredit her and the party, which is part of an ultraconservative coalition that came in third in last year's parliamentary elections, largely on the strength of a virulently anti-American platform.

Ameer-ul Azeem, spokesman for Jamaat-e-Islami, said Qadus had not done anything wrong.

"Arabs, Afghans, Sudanese, it is not a sin to host them as guests, unless their crime is proven," he said when asked whether Qadus or his family had links with Al Qaeda.

Interior Ministry spokesman Iftikhar Ahmed brushed off the family's claims, saying Qadus, Mohammed and the third man were all arrested at the family's home.

"There was a single operation," Ahmed said. "Naturally, they will deny it. Everybody says they are innocent, and you can draw your own conclusion."