A bomb planted outside a girls' school killed three US soldiers in northwest Pakistan yesterday, the army said, in an area that had been largely cleared of militants.

Pakistan's Taliban has claimed responsibility for the attack. In scenes that have become familiar in the struggle between Taliban insurgents and the state, a young girl trapped below the stones of a collapsed wall cried out for help.

Three children and a Pakistani paramilitary soldier were also killed and 45 people were wounded in the blast near Swat Valley, where the government mounted a crackdown nearly a year ago it said had cleared out Taliban militants.

The blast, triggered by a remote-controlled device, was a grim reminder of the resilience of Taliban militants determined to topple the government of President Asif Ali Zardari, a deeply unpopular pro-American leader.

Security officials said earlier that the explosion killed four foreign aid workers.

Pakistan's Taliban have bombed markets, schools and military and police facilities despite major government security offensives that have destroyed some of their bases and US drone aircraft strikes that have killed their leaders.

The three US soldiers were part of a small unit that trains Pakistani Frontier Corps responsible for security in northwestern areas near the Afghan border seen as part of a global militant hub.

They were on their way to attend the opening ceremony of a new girls school that had recently been renovated with US humanitarian assistance when the bomb exploded.

Militants have previously attacked US diplomats and facilities in Pakistan.

"The carnage at the school in Lower Dir clearly shows the terrorists' vision," said a US embassy statement.

The appearance of Pakistani Taliban leader Hakimullah Mehsud, in a farewell video with the suicide bomber who killed seven CIA employees in Afghanistan in December, suggests the group poses an increasingly complex threat to Pakistan's security.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.