Armed residents confronted a group of Taliban fighters and foiled their attempt to sneak into a town in Pakistan's Swat Valley, the focus of a major military offensive against the insurgency, an official said Thursday.

The attempted infiltration in Kalam indicated militants are feeling pinched by the army and are seeking new shelter, while the rare local resistance Wednesday suggested growing public confidence in an anti-Taliban operation supported by the United States.

Deputy Mayor Shamshad Haqqai told The Associated Press about 50 Taliban fighters tried to enter his town, but that armed residents quickly gathered to fight them off. They captured eight militants amid a shootout and were expecting another attack, Haqqai said.

"We will not allow Taliban to come here," he said. Kalam has about 50,000 residents.

The military said Wednesday its troops had killed 80 militants and cleared Sultanwas, a town south of the valley in Buner district. Meanwhile, American military planes brought aid for civilians fleeing the fierce fighting, and Pakistan's government announced it was devoting $100 million to help bring relief to the refugees.

Washington has long pressed Islamabad to clear al-Qaida and Taliban sanctuaries in its northwest regions bordering Afghanistan.

Pakistani troops launched the latest offensive last month after Taliban militants based in Swat pushed into Buner, bringing them within 60 miles (100 kilometers) of the capital of Islamabad and prompting intense U.S. pressure for a stiff response.

The army claims it has killed more than 1,000 militants and won back swaths of territory from militants in Swat, a valley whose scenery and cooler climate once drew hordes of summer tourists.

However, authorities say the clashes have prompted about 1.9 million people to flee their homes, creating a humanitarian crisis that could sap Pakistani enthusiasm for the effort if it drags on or is extended to other areas.

Pakistani generals have refused to predict how long it will take to eliminate militants from Swat.

However, Rear Adm. Michael A. LeFever, the top U.S. military official at the U.S. Embassy in Islamabad, forecast Wednesday that between 200,000 and 250,000 will be living in refugee camps at least until the end of 2009.

Relatives have taken in most of those driven out of Swat in fear of their lives. But about 160,000 refugees have registered so far at the camps, Information Minister Qamar Zaman Kaira said Wednesday.

Many thousands more are believed to be hunkered down in their homes in Swat, unwilling or unable to move.

U.S. Secretary of State Hillary Rodham Clinton announced Tuesday that Washington would provide $110 million in immediate humanitarian assistance to Pakistan. As part of that support, two American military planes touched down Wednesday at an air base near Islamabad laden with air-conditioned tents and 120,000 pre-packed meals, the U.S. Embassy said.

U.S. authorities say they already delivered shipments of wheat and vegetable oil valued at about $28 million to Pakistan last week.

Pakistani Prime Minister Yousuf Raza Gilani was expected to preside over a donors conference for the refugees in Islamabad later Thursday to seek help from other countries and aid agencies.

A meeting of top Pakistani government officials Wednesday resulted in a decision to devote $100 million to ease the humanitarian emergency, said Farahnaz Ispahani, a spokeswoman for the country's president.