A homicide bomber struck a bus carrying schoolchildren Monday at a military base in northwestern Pakistan, wounding at least five of the children, an army spokesman said.

The attack occurred at the army's base at Kamra, and the wounded children were being transported to a hospital, Maj. Gen. Arshad Waheed said.

"This barbaric attack shows how cruel the terrorists are," he said, adding that the bus driver and a guard also were injured.

Pakistan, a key ally of the United States in its war on terror, has witnessed scores of terrorist attacks that have claimed hundreds of lives in the past several years.

The latest attack came a day after a homicide bomber rammed an explosives-laden car into a police outpost Sunday, killing four people and wounding several others, in Pakistan's Swat valley, the site of a military operation against Islamic militants loyal to a fugitive cleric

The attack occurred after the commander of military operations in Swat said his forces had cleared the valley of insurgents, a military spokesman said.

Militants this summer seized tracts of the area, a former tourist destination 160 kilometers (100 miles) from the capital, Islamabad. On Saturday, the army announced that government troops had retaken all the towns seized by the militants, killing 290 of them and capturing 140.