The Pakistani military has captured a high-ranking Taliban commander who once tried to assassinate former president Pervez Musharraf and later escaped jail with hundreds of other prisoners, security officials have said.

Adnan Rashid was captured on Friday in a house where he was living with his family in northwest Pakistan's mountainous region bordering Afghanistan, the officials said on Tuesday. He was injured in a shootout during the arrest.

Rashid, captured in the Wana area of South Waziristan, is the first major Taliban commander captured since the military launched an offensive in neighbouring North Waziristan last month. The army says it will drive Taliban fighters from their key strongholds in the region.

He was arrested along with a local key al-Qaeda commander, Mufti Zubair Marwat, according to intelligence sources.

Rashid is also accused of taking part in several attacks on key government installations, including Kamra air base.

The latest offensive followed years of pressure on Pakistan by its NATO allies to crack down on Taliban havens in tribal regions bordering Afghanistan.

But local residents said that most rebels moved out well before ground troops arrived.

More than half a million civilians have fled their homes since the military offensive began last month. Government figures show more than 900,000 have sought aid, although that also indicates fraud and duplications.

Jail break

Since then, the government has seized control of Miranshah, the capital of North Waziristan, and claims to have killed hundreds of fighters.

Rashid, believed to be in his mid-30s, is a former Pakistani air force officer who tried to become a suicide bomber before he was jailed for a 2003 attempt to blow up then-President Musharraf, Reuters news agency reported.

He escaped from jail in 2012 along with nearly 400 other rebels after fighters attacked Bannu prison using rocket propelled grenades and assault rifles.

Following his release, he claimed responsibility for masterminding another jail break that freed 250 prisoners, made a series of YouTube videos and wrote an open letter attempting to justify the assassination attempt on schoolgirl activist Malala Yousafzai.

Local residents in the area where Rashid was captured say that leaflets purporting to be from the Taliban were being circulated, blaming Rashid's capture on some local Taliban commanders and promising vengeance.

In recent months the Pakistani Taliban has been beset by a series of internal power struggles.

Also on Tuesday, three Pakistani soldiers and six Taliban fighters were killed in a gun battle in the village of Fateh Khel near the town of Mir Ali in North Waziristan.