KARACHI, Pakistan — At the age of 11, Malala Yousafzai took on the Taliban by giving voice to her dreams. As turbaned fighters swept through her town in northwestern Pakistan in 2009, the tiny schoolgirl spoke out about her passion for education — she wanted to become a doctor, she said — and became a symbol of defiance against Taliban subjugation.

On Tuesday, masked Taliban gunmen answered Ms. Yousafzai’s courage with bullets, singling out the 14-year-old on a bus filled with terrified schoolchildren, then shooting her in the head. Two other girls were also wounded in the attack.

All three survived, but on Wednesday a neurologist said Ms. Yousafzai was in critical condition at a hospital in Peshawar, though doctors had been able to remove a bullet. A government official in Peshawar, speaking on condition of anonymity, said arrangements had been made to send Ms. Yousafzai abroad for treatment, but that doctors had said she should not be moved for now. The two other wounded girls were reported to be in stable condition.

A Taliban spokesman, Ehsanullah Ehsan, confirmed by phone Tuesday that Ms. Yousafzai had been the target, calling her crusade for education rights an “obscenity.”