Updated

More than 80 percent of Pakistanis view the Taliban as a critical threat to the country, an opinion poll released Wednesday said, marking a major shift in public support behind the government's campaign against the fundamentalist Muslim militants.

The turn in public mood is a boost to the military in its offensive against the insurgency -- a campaign supported by the Obama administration, which believes security in Pakistan is vital to defeating the Taliban in neighboring Afghanistan.

Pakistan's army has been battling militants in the Swat Valley in the country's northwest, a campaign that has driven some 2 million civilians from their homes since April. The military has also expanded its campaign in recent weeks to the mountainous tribal regions of North and South Waziristan along Pakistan's border with Afghanistan, where top Taliban and Al Qaeda leaders are believed to be hiding.

The survey showed that 81 percent of Pakistanis believe the activities of the Taliban and other Muslim extremists were a "critical threat" to the country, up from the 34 percent polled on the same question in September 2007.

Socio-Economic Development Consultants in Islamabad carried out the survey for WorldPublicOpinion.org, questioning 1,000 people across Pakistan from May 17 to 28, 2009. It gave a margin of error of plus or minus 3.2 percentage points.

Despite the refugee crisis triggered by the Swat operation, 68 percent of the poll's respondents expressed confidence in the government's handling of the Swat campaign, and 70 percent said their sympathies lie with the government -- compared to only 5 percent for the Taliban.

A majority of Pakistanis have always opposed Islamist extremists although they have not necessarily viewed them as a threat to the country. Distrust of the United States and anger at the invasion of Afghanistan -- coupled with a widely held view that Islamabad was acting against the militants at the behest of Washington -- has also influenced the debate in the country.

But the military says the shift has made its job easier. Residents in areas affected by offensives have become more cooperative, sharing information on militant positions, army officials have said. And in some spots, such as the Dir region, local tribesmen have launched their own militias to root out insurgents.

Previous army offensives against the militants have faltered, with many people believing the only way to end the bloodshed was for the central government to strike a deal with the extremists.

The government did just that with militants in Swat in February, only for the deal to collapse when the Taliban advanced into the neighboring Buner district in April. The government then sent the army to oust the militants from the region.

The Taliban's violation of that deal -- plus a widely circulated video showing a militant allegedly beating a women in Swat and a surge in suicide attacks around the country over the last year -- have contributed to the shift in public opinion.

The poll said that 78 percent of the respondents support shutting down Taliban bases in Pakistan used in efforts to overthrow the Afghan government, but 81 percent of respondents oppose U.S. missile strikes on such camps.

Washington says the Taliban is using Pakistan's tribal belt as a safe haven for launching attacks on U.S. and other western forces in Afghanistan, and has pushed Islamabad to crack down on the militants.

The U.S. has also fired more than 40 missiles at suspected militant targets in the tribal regions over the last year -- including a strike last week that killed 80 people. The drone attacks have killed many militants but have served as a rallying cry for the insurgents.

WorldPublicOpinion.org is a project involving research centers from around the world that is managed by the Program on International Policy Attitudes at the University of Maryland.