First Battle of Swat The First Battle of Swat , also known as Operation Rah - e - Haq , was fought between Pakistan and the Taliban in late 2007 over control of the Swat District of Pakistan . The battle began on October 25 , 2007 and involved the Pakistani Army and Taliban - led forces in a fight for control of the Swat district of Pakistan . From October 25 , 2007 , to November 7 , 2007 , the militants quickly seized control of the region . On November 15 , 2007 , a Pakistani offensive commenced . The battle . First phase - Taliban occupy Swat . On 24 October , more than 3 , 000 Pakistani infantry troops were sent to Swat to confront Taliban forces that were massing in the district in a bid to impose their version of Sharia law in the valley that included preventing women ' s education , death penalty for barbers , music shop owners , and thieves , along withan anti Polio - vaccination campaign to prevent the local population from getting vaccinated . The Pakistani infantry troops deployed to the hill - tops of the rugged terrain . On October 25 , heavy fighting started with a suicide bomber attacking a paramilitary truck and killing 17 soldiers and 13 civilians . Fighting erupted in the hills with Taliban forces attacking military posts and the military attacking Taliban mountain hideouts . By 31 October , the military reported that up to 130 militant fighters were killed , however the next day about 700 militants overran a military position on a hill in Khwazakhela . Around 50 soldiers deserted their positions and another 48 were captured and paraded the next day . All of the soldiers were later freed . Also , police forces in Matta were completely surrounded by the end of the day . On 3 November , 120 police forces and paramilitary troops in Matta surrendered and then deserted after they were disarmed . The Taliban also overran the nearby town of Khwazakhela , thus taking two police stations and took a large arsenal of weapons that was in them . There was no major fighting until 7 November , when the Taliban continued their advance and took the town of Madyan . The police there also gave up their weapons , vehicles and control of local police stations . The insurgents occupied the floodplain side of the broad Swat river , which sweeps up towards the Hindu Kush mountains , while the remaining Pakistani infantry troops held the road that follows the steep , forested hills . This left the Taliban in control of most of the Swat district and by then they had already set up their own local ' governors ' in Tehsil Kabal , Matta and Khawazkhela . Second phase - Battle for Shangla , Pakistani offensives . On 12 November , 5 , 000 soldiers belonging to 12th Regular Army were deployed to Swat to bolster the already 15000 para - military and police that were already fighting to keep what ground of the district they still held . The Pakistan Army mounted a number of operations to counter the militants and their expanse . However , on November 15 , militants advanced from Swat , which was now under their control , into the next district to the east , Shangla . That day Alpuri , which is the district headquarters of Shangla , fell to the Taliban insurgents . As the militant force was coming towards the town the police force deserted without a fight . The military quickly turned the focus of their operations now not to take back Swat but to keep Shangla . By 17 November , an estimated 100 militants were killed in the fighting . On November 25 , Taliban forces decided to leave Alpuri because of the huge Pakistani infantry forces moving towards the area . The Taliban evacuated Alpuri and took up positions on the mountaintops around the town . Meanwhile in Swat on 26 November , Pakistani artillery resulted in the death of two top Taliban commanders . With artillery fire and ground forces , the Pakistani Army tried to recapture many strategic hilltops from the Taliban and indeed , they managed to capture some of the hilltops and drove the Taliban back to the Swat district . The fighting for the hilltops left 4 Pakistani soldiers and 45 Talibani forces , led by Mullah Fazlullah , dead . On 27 November , Pakistani forces secured Shangla . Third phase . Pakistani forces had retaken the Shangla district , but pockets of Swat were still in the hands of the insurgents . By 27 November , Pakistani ground forces were not able to reach Matta , Khwazakhela , Charbagh and other sensitive areas occupied by militants . The security forces concentrated on Imam Dehri , the native village of Maulana Fazlullah , and nearby Kuza Banda , Bara Banda and Nigwalai . Once fighting commenced , most insurgents retreated to nearby areas . The highest peak in the Kabal district was retaken and other recent gains were consolidated . After suffering colossal losses , the militants in Swat vacated all seized police stations and other government buildings by 28 November and decided to go underground while the government closed down all FM radio channels in the district , including the one run by Maulana Fazlullah . Also on 28 November , the Pakistan Army had cleared Imam Dehri , the headquarters of Maulana Fazlullah ' s seminary , and police resumed their normal duty in Alpuri , the district headquarters of Shangla . Around 50 militants were killed in four days of fighting . The militants vacated Matta , Khwazakhela and Madyan police stations and fled to nearby forests . They also left the Charbagh police post in Khwazakhela , their stronghold about 27 km from Mingora . Police and troops were yet to enter the areas , as pounding of suspected militant positions continued and specialists were called in to sweep the area for mines and booby traps . On 5 December , the Pakistan army entered and took full control of the town of Matta , followed by the capture of the towns of Khwazakhela and Imam Dehri on 6 December . Imam Dehri was the previous home of Maulana Fazlullah and his radio station . Subsequent Operations . In between , Pakistan Army launched various military operations to defeat the Taliban militants , but had to bow down to political pressure , which demanded for peace . Operation Rah - e - Haq - II was launched in July 2008 as the first infantry division was deployed . This time the military operation was led by both Air Force and Army . The operation was relied on both air power as well as heavy artillery . Soon the Taliban Forces , led by Faqir Mohammed , started playing havoc in Bajaur Agency . So the Army started Operation Sherdil . The Army launched Operation Rah - e - Haq - III in January 2009 to secure the main supply lines and consolidate Swat District . Frontier Corps infantry troops provided help to four army infantry brigades . The last week of January saw intensive aerial and artillery bombing . The forces regained Mingora and were poised to push the Taliban out of the district when Sufi Muhammad was released and Shariah was introduced in Swat and Malakand . The provincial government was confident of the outcome of the peace deal . However , the TTP betrayed the government by regrouping and capturing Swat , Buner , Mingora , Shangla and its surrounding areas . When the situation went out of hand , the provincial government requested the center to ask the Army to provide help . Events show that the Army never avoided taking decisive action but bowed to political pressure from the center and provincial government . However , it did so at an extremely high cost . Aftermath . Despite the victory by the Pakistani army , Taliban militants slowly re - entered Swat over the following months and started engaging security forces in battles that lasted throughout 2008 . By early February 2009 , the Taliban had managed to regain control of most of Swat and at least 80 percent of the district was under their control . February 2009 ceasefire . The Pakistani government announced on February 16 , 2009 that it would allow the Sharia law under the government ' s supervision with a sharia courts setup by the Government of Pakistan under the Shariat appellate bench of the Supreme court in the Malakand region . In return , Fazlullah ' s followers agreed to observe a ceasefire negotiated by Sufi Muhammad . But the government of Pakistani president Asif Ali Zardari later changed the agreement to allow the right of appeal to the supreme court of Pakistan ( a secular institution observing the Pakistani penal code based on English common law ) on verdicts issues by the Shariat court which was unacceptable to the TNSM and would be the precursor to the Second Battle of Swat