ISLAMABAD - The United Nations launched an appeal on Friday for $543 million for more than 2 million people displaced by fighting in northwest Pakistan, where officials said villagers were turning against the Taliban.

The military launched an offensive this month in the picturesque Swat Valley and neighboring districts to stop the spread of a Taliban insurgency that had raised fears for nuclear-armed Pakistan's future.

The United Nations has warned of a long-term humanitarian crisis and called for massive aid for nearly 1.7 million people displaced by the offensive and about 555,000 people forced from their homes by earlier fighting in the region.

The scale of this displacement is extraordinary in terms of size and speed and has caused incredible suffering, said Martin Mogwanja, the acting U.N. humanitarian coordinator, in launching the flash appeal.

We require a total $543 million assistance until the end of December this year, Mogwanja told diplomats and reporters.

The U.N. appeal came a day after Pakistan's allies promised $224 million, including $110 million from the United States, after the government warned that the militants could exploit a failure to help.

The United States, which sees Pakistan as vital to its plan to defeat al Qaeda and bring stability in Afghanistan, has applauded Pakistani resolve to fight what some U.S. leaders have called an existential threat to the country.

Even if the Pakistani military defeats the Taliban quickly and people can go home soon, they will need help for months because their crops are rotting in the fields, aid officials say.

Pakistan could face greater turmoil in the months ahead.

U.S. Joint Chiefs of Staff Admiral Mike Mullen said on Thursday a U.S. military offensive in southern Afghanistan could push Taliban fighters into Pakistan.

The United States is pouring thousands of extra troops into Afghanistan this year to try to reverse gains by a resurgent Taliban, particularly in its southern heartland.

TALIBAN GET OUT

About 15,000 members of the security forces are fighting between 4,000 and 5,000 militants in Swat, the military says.

Pakistan says more than 1,000 militants and more than 50 soldiers have been killed in the fighting. There has been no independent confirmation of the estimate of militant casualties.

The government has the backing of most politicians and many members of the public for the offensive but that support could quickly disappear if many civilians are killed or if the displaced languish in misery.

In a sign of growing hostility toward the Taliban among people long ambivalent, villagers in two northwestern districts were raising militias, or lashkars, to try to expel the gunmen, officials said.

They are resolutely defending against the advance of the Taliban. That's is the silver lining that I can see, Major-General Sajjad Ghani, who is leading the offensive in the upper part of Swat, told a small group of visiting journalists.

Provincial assembly member Jafar Shah said a clash had erupted on Thursday between Taliban and villagers in the Kalam region to the north of Swat and several people on both sides were wounded or killed.

The people of Kalam have risen against the Taliban, he said. Villagers had taken the same stand in parts of Lower Dir, to the west of Swat, and the Taliban had pulled out of some areas, a provincial government official said.

In Swat, soldiers advancing from three directions have begun battling the militants in towns where civilians are still hiding.

The head of the government relief operation, Lieutenant General Nadeem Ahmed, said on Thursday up to 200,000 civilians were stranded in the valley and authorities might have to drop food to them from the air.

Separately, a suicide bomber killed four civilians in South Waziristan near the Afghan border late on Thursday and the army attacked positions of Pakistani Taliban leader Baitullah Mehsud with artillery on Friday, security officials said.

President Asif Ali Zardari has said that after Swat, the army would move against militants in Waziristan.