BUNER VALLEY, Pakistan - The Pakistan army battled through mountain passes on Thursday in a third day of fighting to evict Taliban fighters from a strategic valley, after U.S. President Barack Obama welcomed its newfound resolve.

The militants were still controlling parts of Buner valley, just 100 km (60 miles) northwest of the capital, Islamabad, though troops had secured the main town of Daggar on Wednesday after helicopters dropped them behind enemy lines.

Obama told a news conference in Washington on that Pakistan's army had begun to realize that homegrown militants and posed a bigger current threat to the Muslim nation's stability than India, despite three wars between the two old rivals.

On the military side, you're starting to see some recognition just in the last few days that the obsession with India as the mortal threat to Pakistan has been misguided, and that their biggest threat right now comes internally, Obama said.

And you're starting to see the Pakistani military take much more seriously the armed threat from militant extremists.

The Taliban's creeping advance from their stronghold in Swat valley, unnerved many Pakistanis and raised fears in Washington that its nuclear-armed ally was becoming more unstable.

Obama said he was confident about the security of Pakistan's nuclear arsenal.

SWAT NEXT?

On Thursday troops used helicopter gunships and artillery to target militants hideouts in Buner, and hundred of families were seen streaming out of the valley, their vehicles laden with whatever belongings they could carry, including cattle.

We are leaving but we don't know where we will be going. There was shelling over my village the whole night, said an old woman, her head and face covered, as she sat on the back of a pick-up truck.

Military spokesman Major-General Athar Abbas said security forces has won control of at least two passes on Thursday, but were having to move carefully because of roadside bombs.

He also delivered a warning to the Taliban in Swat for failing to keep their side of the bargain after the government accepted demands to establish Islamic sharia courts across the Malakand Division of North West Frontier Province, which includes Swat, Buner and several other districts.

The terrorism, terrorizing of people of the area is continuing unabated and this we consider a gross violation of peace deal, Abbas told a news conference in Rawalpindi, the garrison town neighboring Islamabad.

Abbas said the militants had refused to disarm, had abducted security forces personnel and killed policemen and civilians.

U.S. officials have urged Pakistan to follow through on this week's offensives in Dir and Buner rather than let the enemy regroup, and speculation was mounting that once the army has secured Buner it will turn its attention to the Taliban in Swat.

Abbas gave no casualty update from the fighting in Buner and Lower Dir, where an operation began on Sunday, but as of Wednesday more than 120 militants had been killed.

OBAMA GRAVELY CONCERNED

Before the military offensive in Buner, Western allies, who need Pakistan's support to defeat al Qaeda and stabilize neighboring Afghanistan, were worried the government seemed too willing to appease militants.

I am gravely concerned about the situation in Pakistan, not because I think that they're immediately going to be overrun and the Taliban would take over in Pakistan, Obama told a news conference in Washington on Wednesday.

I'm more concerned that the civilian government there right now is very fragile and don't seem to have the capacity to deliver basic services: schools, health care, rule of law, a judicial system that works for the majority of the people.

Mounting insecurity in Pakistan was underlined by ethnic violence in the southern city of Karachi, where paramilitary troops were given orders to shoot on sight to restore order.

At least 27 people were killed in clashes on Wednesday, many of them ethnic Pashtuns, illustrating another strand of the tensions between the people of the northwest and those from other parts of the country.

Obama is due to meet Pakistan's President Asif Ali Zardari and Afghan President Hamid Karzai in Washington on May 6-7.

U.S. lawmakers said they planned to accelerate the flow of more than $400 million in aid to Pakistan to help with counter-insurgency operations. The U.S. is also giving $1.4 billion in economic aid for Islamabad.