Imran Khan, the cricket star turned opposition politician, offered to pay for her treatment, while officials from his party parried accusations that they were soft on the Taliban.

Last weekend Mr. Khan led a motor cavalcade of supporters to the edge of the tribal belt as part of a demonstration against American drone strikes in the area — a theme that, until now at least, has frequently been a more concentrated focus of public anger than Taliban violence.

Even Jamaat ud Dawa, the charity wing of the militant group Lashkar-e-Taiba, which follows a different strain of Islam from the Taliban, condemned the attack. “Shameful, despicable, barbaric attempt,” read a message on the group’s official Twitter feed. “Curse b upon assassins and perpetrators.”

Image The attack on Malala Yousafzai occurred in Mingora, Swat Valley’s main town, when masked gunmen stopped a bus carrying schoolgirls who had just taken an exam. Credit... The New York Times

The anger was amplified by the Taliban’s brazen claims of responsibility for the shooting, and by avowals that the group would attack Ms. Yousafzai again if it got a second chance. Reports circulated that the Taliban had also promised to target her father, Ziauddin Yousafzai, who privately appealed to neighbors from Swat not to visit the hospital in case of a second attack.