ISLAMABAD - Pakistani forces repelled a mass assault on their outpost near the Afghan border Saturday in a battle that left 18 dead and shook claims by Pakistan's army to have regained control of a critical region.

A separate clash in the nearby Swat Valley piled pressure on a disputed peace deal there, while a Taliban commander suspected in attacks on trucks carrying supplies to NATO and U.S. troops in Afghanistan surrendered to authorities, officials said.

Under the peace deal, the government agreed to impose Islamic law in Swat and nearby areas to halt two years of bloody fighting. The controversial pact has been likened by the United States to surrender. It heralded a militant push into a neighboring district within 60 miles (100 kilometers) of Islamabad.

In an interview with CNN, due to air on Sunday, U.S. Defense Secretary Robert Gates said the militants' expanding reach in the northwest of Pakistan posed an "existential threat to the democratic government in Pakistan."

Gates said the United States was willing to provide all the training and equipment Pakistan's military needed to help combat the growing threat.

"There has been reluctance on their part up to now. They don't like the idea of a significant American military footprint inside Pakistan. I understand that ... but we are willing to do pretty much whatever we can to help the Pakistanis in this situation," he said in the interview. CNN released the transcript to The Associated Press.

The United States has bankrolled Pakistan's government and army with billions of dollars since Pakistan abandoned its support of the former hardline Taliban regime in Afghanistan after the Sept. 11, 2001, attacks. While Pakistan has launched numerous military operations along the frontier since then, security has only deteriorated.

Pakistani generals claimed earlier this year to have dismantled Taliban mini-states in the northwestern tribal regions of Mohmand and Bajur, from where insurgents were attacking U.S. troops on the other side.

Yet militants still control much of the frontier region, which U.S. officials view as the likely hiding place of al-Qaida chief Osama bin Laden, and have made alarming advances toward several major cities.

According to the army, about 100 insurgents took part in Saturday's attack on the Spinal Tangi security post in Mohmand.

"Sixteen militants were killed in retaliatory fire. Two security forces personnel embraced shahadat (martyrdom)," a military statement said.

Syed Ahmad Jan, a senior administrator for Mohmand, said three more troops were wounded.

Few reporters work in the remote border zone because of poor security, making it hard to verify the army's account. A Taliban spokesman in the region could not be reached for comment.

Pakistani counterinsurgency efforts are currently focused on Buner, a hilly farming district near the Indus River that was infiltrated last month by hundreds of Taliban militants.

The advance triggered alarm in Pakistan and the West for the stability of the nuclear-armed country.

In his interview, Gates said his impression from afar was that Pakistani security forces had "begun to regain the initiative" in Buner. He said the militant intrusion into the district was "a real wake-up call for the Pakistani government."

Pakistan's army says it has killed more than 100 militants and lost several soldiers since the fighting began on Tuesday. Militants have taken dozens more security personnel prisoner. Hundreds of civilians have fled the area.

On Saturday, the army said it was clearing bombs laid along one of two main roads it has secured and that it would soon let civilians travel to Buner's main town, Daggar. Warplanes have bombed militant strongholds further north.

Still, officials in Pakistan's northwest have sought to keep the Swat peace pact alive, arguing that the Islamic law concession will persuade some to lay down their arms and isolate hard-liners.

But a cease-fire in the valley is under growing strain.

The army said troops exchanged fire with militants who refused to stop their jeep at a checkpoint in Swat on Friday and that five militants were detained while planting a bomb.

In better news for the government, a Taliban commander in the Khyber region, just west of Peshawar, surrendered Saturday after authorities put pressure on his tribe, local official Bakhtiar Khan said.

He said Iftikhar Khan Afridi was aligned with Baitullah Mehsud, the top Pakistani Taliban commander whom U.S. officials accuse of assisting insurgents in Afghanistan.

"We think his arrest will help reduce the attacks on the NATO supplies," the official said.

Militants have mounted repeated attacks on trucks that pass through the famed Khyber Pass in northwestern Pakistan on their way to Afghanistan to supply international forces there.