MINGORA, Pakistan (Reuters) -- Pakistani aircraft have bombed Taliban positions in Swat, a day after the prime minister ordered the military to eliminate terrorists and on the heels of a commitment to the United States to fight extremists.

Helicopter gunships, fighters, and troops were all involved in operations in Swat, and up to 12 militants were killed after as many as 55 were killed the previous day, Major Nasir Khan, a military spokesman in Swat, said by telephone.

Prime Minister Yusuf Raza Gilani had said in a televised address late on May 7 that militants were trying to hold the country hostage at gunpoint.

"In order to restore honor and dignity of our homeland and to protect the people, the armed forces have been called in to eliminate the militants and terrorists," he said, setting the stage for a major offensive against Taliban fighters battling security forces in Swat.

The struggle in the scenic northwestern valley 130 kilometers from Islamabad and a former center for tourism has become a test of Pakistan's resolve to fight a growing Taliban insurgency that has alarmed the United States.

Pakistan President Asif Ali Zardari, in talks in Washington this week, assured U.S. President Barack Obama of Islamabad's commitment to defeating Al-Qaeda and its allies.

Pakistan's efforts against militants sheltering near the border with Afghanistan are seen as vital to efforts to defeat the insurgency in that country, while increased problems with militants in areas closer to Islamabad, such as Swat, raised concern about the stability of nuclear-armed Pakistan.

The military's Khan said: "Our gunship helicopters today targeted and destroyed two militant hideouts in Kabal and we have confirmed reports that 10 to 12 militants have been killed," referring to a militant stronghold 17 kilometers northwest of Swat's main town of Mingora.

He said there was also ground action accompanied by air strikes in other parts of the valley, and an important Taliban commander had been killed the previous day.

Civilians Flee

Tens of thousands of civilians have fled the fighting this week. With hundreds of thousands already displaced by earlier battles between the government and Islamist militants, aid groups said the new exodus was intensifying a humanitarian crisis.

The United Nations high commissioner for refugees expressed his deep concern about the safety of people displaced by the fighting while the International Committee of the Red Cross said a humanitarian crisis was intensifying.

Gilani did not announce the launching of a specific offensive but said the government would not bow before terrorists and would force them to lay down their arms.

Reinforcements have been arriving in Swat as a peace pact collapsed. On May 6, soldiers launched assaults in the outskirts of Mingora, where the Taliban occupied important buildings.

Authorities agreed in February to a Taliban demand for the introduction of Islamic Shari'a law in the valley but the militants refused to disarm, and pushed out of Swat closer to the capital.

Although many Pakistanis have had doubts about the need to fight the militants, saying Washington wanted Islamabad to fight its battle, the mood among at least some seemed to be shifting.

"If the government is serious in eliminating militants from Swat then we will support the military operation," Khalid Khan, a social worker and resident of the Dheri Baba area in Swat, told Reuters.

"We are ready to make every sacrifice if the government really means business this time," said Gul Omer, a poultry trader, referring to previous, inconclusive military action that was followed by the peace deal.