Pakistan- Pakistan's Taliban claimed responsibility for a bomb on Wednesday that killed three U.S. soldiers outside a girls school in the northwest of the country and threatened more attacks on Americans.

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 after the blast.

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.

We will continue such attacks on Americans, Taliban spokesman Azam Tariq told Reuters by telephone from an undisclosed location.

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.

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 U.S. drone aircraft strikes that have killed their leaders.

The three U.S. 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 U.S. humanitarian assistance when the bomb exploded, leaving a crater a few feet away from the school.

PREVIOUS ATTACKS

Militants have previously attacked U.S. diplomats and facilities in Pakistan.

The carnage at the school in Lower Dir clearly shows the terrorists' vision, said a U.S. 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.

The United States is leaning heavily on long-time ally Pakistan to help it stabilize Afghanistan, a top foreign policy priority for President Barack Obama.

It wants Islamabad to eliminate al Qaeda and Afghan Taliban militants who cross over the border to attack U.S.- and NATO-led troops in Afghanistan.

But nuclear-armed Pakistan is focused on fighting homegrown Taliban who have blown up dozens of girls' schools and publicly flogged and executed those deemed immoral by an austere interpretation of Islamic rule they are bent on imposing.

The possibility that some of his aides will be prosecuted under revived corruption charges and growing public frustrations with a sluggish economy and chronic power cuts have also piled pressure on Zardari.

U.S. drone strikes in northwest Pakistan have intensified since the attack on the CIA in Afghanistan, but analysts say they are unlikely to pose a long-term danger to the Taliban, who seem to carry out suicide bombings at will.

The death toll from drone attacks on Tuesday night -- the heaviest ever in terms of the number of missiles fired -- has risen to 31, security officials said.

(Additional reporting by Zeeshan Haider and Kamran Haider; Writing by Michael Georgy; Editing by David Fox)