The Taliban in Malakand have signed a shaky peace deal with the government [EPA]
The Taliban in Pakistan used to function mainly in North and South Waziristan in the country's northwest region bordering Afghanistan, but the fighters have managed to spread their area of influence.
The movement in Pakistan was formed after Western forces in 2001 forced the Taliban government from power in Afghanistan, where it had ruled since 1996, implementing its strict version of Islamic law, or sharia.
After the fall of the Taliban government in Kabul, many fighters fled over the porous Afghan border with Pakistan and found refuge in the inhospitable and mountainous territory of North and South Waziristan.
They paid local tribal leaders for their support against Pakistan's security forces, and used the territory to assist attacks in border areas of Afghanistan.
Al-Qaeda elements are believed to hide in the same terrain, planning their assaults against international forces in Afghanistan.
The Taliban in Pakistan works in small groups and are highly mobile, carrying out surprise attacks on military and civilian targets, often causing a large number of deaths.
The Taliban of the region and al-Qaeda have close ties. The US invaded Afghanistan on the pretext that the government would not hand over Osama bin Laden, the leader of al-Qaeda in Afghanistan.
Although it is difficult to say how many members it has, its nucleus may number several thousand.
Those Pakistanis whose support they have been able to get are typically jobless Pashtun tribesmen.
They do not have a single leader, but look to Mullah Mohammad Omar, the elusive leader of the toppled Afghan Taliban government, as a symbol and iconic figure for their movement.
Taliban fighters began last year to launch attacks in the northwestern districts of Bajaur and Swat with increasing frequency.
In February this year, the civilian government of Asif Ali Zardari struck a controversial deal with the Taliban in the Malakand region, of which Swat is a part, in an attempt to restore peace.
The government agreed to implement a stricter version of sharia under condition the Taliban laid down their arms.
The deal was negotiated by Sufi Muhammad, a Muslim religious leader who was released from jail last year to act as a go-between with the Taliban.
He had been imprisoned for sending men to fight against Western forces in Afghanistan during the 2001 US-led invasion.
Muhammad is the father-in-law of Mullah Fazlullah, the leader of the Taliban in the Swat valley.
Fazlullah and his followers have been accused of destroying about 200 schools, most of them for girls, and of beheading government officials.
The setting up of a sharia justice system for Malakand was approved by parliament and signed by Zardari, but the government insisted that it would not be implemented until the Taliban disarmed.
The deal was criticised by the US, which has pressured Pakistan to tackle the Taliban rather than negotiate with it.
In April, hundreds of Taliban fighters moved into Buner, a district adjoining Swat in Malakand, expanding their influence, setting up checkpoints and occupying mosques there.
After urging the fighters to leave, the military launched a largely successful offensive to force them out of the area.
But the Taliban continued to attack targets across Pakistan and in October the military launched an large-scale offensive against Taliban strongholds in South Waziristan.