Pakistani troops have retaken the largest city in the Swat Valley from the Taliban as the army presses its offensive against militants in the country's northwest, the army spokesman said Saturday.

taliban-swat-cp-6782612

Pakistani soldiers display arms and ammunition confiscated from militants in Mingora in the troubled Swat Valley. ((Associated Press))

Government forces had full control of Mingora — with a population of around 300,000 — although they were still meeting pockets of resistance from fighters on its outskirts, Maj. Gen. Athar Abbas told The Associated Press.

The military launched a major offensive one month ago in the Swat Valley and neighbouring areas to oust Taliban militants who were extending their control over the northwestern region, near the border with Afghanistan.

The campaign is strongly backed by Washington and the government's other Western allies, who see it as a test of the government's resolve to fight extremism in the Pakistan.

"As far as Mingora city, security forces have taken over," Abbas said. "There are still pockets of resistance. They are on the periphery of Mingora city."

Government troops have been advancing steadily into the Swat region, bombarding towns from the air and fighting house-to-house with Taliban gunmen.

The fighting has caused more than 2 million people to flee the region, raising fears of a humanitarian crisis. More than 160,000 people are taking refuge in sweltering refugee camps south of the battle zone, while the rest are staying with relatives or relying on goodwill from local residents.

Widespread domestic support for the campaign could sour if the government is perceived to have failed the refugees or if a high number of civilian casualties is revealed.

The Taliban has warned it will launch terrorist strikes in Pakistani cities in retaliation for the campaign, and claimed responsibility for a gun and suicide bomb attack on Wednesday in the eastern city of Lahore that killed at least 30 people. A day later, three suicide bombings killed at least 14 people in two cities in the northwest.

The military says more than 1,100 militants have been killed in the Swat offensive and tens of troops, but that civilian casualties have been minimal. The tally and the extent of destruction caused by the fighting is largely unknown because media have been restricted from traveling in the region.

Prime Minister Yousuf Raza Gilani on Saturday defended the decision to launch the offensive, saying it was necessary because the Taliban had challenged the authority of the government by advancing from its stronghold of Swat to the neighboring district of Buner, just 100 kilometres from the capital, Islamabad.

"The very existence of Pakistan was at stake, we had to start the operation," Gilani told a group of workers at state-owned Pakistan Television.

He promised cash payments to people forced from their homes and a massive reconstruction effort.