The Taliban's attempt to kill a 14-year-old girl, famous for speaking out against the Islamic militants and their attacks on girls' education, has triggered a wave of national revulsion in Pakistan .

Malala Yousafzai was shot in the head and neck while she sat with classmates on a school bus as it prepared to drive students home after morning classes in Mingora, a city in the Swat valley, where the army mounted major operations in 2009 to crush a Taliban insurgency.

She was taken to hospital before being whisked in a military helicopter to an intensive care ward in Peshawar.

Police said a bearded man approached the bus and asked which of the girls was Malala. When one of the girls pointed at her she denied it. The gunman shot both girls, although police say three people were wounded in all.

A Taliban spokesman, Ehsanullah Ehsan, claimed responsibility on behalf of the Tehreek-e-Taliban Pakistan (TTP), the Pakistani offshoot of the Taliban movement notorious for its restrictions of women's freedom and female education during the five years before late 2001 when they were in power in Afghanistan.

"She was pro-west, she was speaking against Taliban and she was calling President Obama her ideal leader," Ehsan told Reuters. "She was young but she was promoting western culture in Pashtun areas," he said, referring to the main ethnic group in north-western Pakistan and Afghanistan from which the Taliban finds most of its followers.

The Taliban had previously announced the girl was on their "hit list" because of her backing for "the imposition of secular government" in Swat.

With the country's boisterous news channels turning their attention to detailed discussions of the incident, leaders of all the mainstream parties issued statements harshly condemning the shooting.

Raja Pervez Ashraf, the prime minister, ordered the helicopter be sent to move her from Mingora, while President Asif Ali Zardari sent flowers to her bedside.

Yousafzai rose to fame in 2009 during the Pakistani army operations to crush a Taliban insurgency that had taken hold in the Swat valley, a beautiful mountainous area three hours drive from Islamabad. It was a popular place for Pakistani tourists before the Taliban began a takeover of the area, closing girls' schools, forcing men to grow beards and beheading their opponents.

At a time when even Pakistani politicians appeared to be appeasing the Taliban, Yousafzai spoke out against the militants. She wrote a blog for the BBC's Urdu service website under the pseudonym Gul Makai ("cornflower") about the chaos of the time, including the fears of her classmates that their educations would be abruptly stopped.

Her efforts were recognised by the then prime minister, Yousuf Raza Gilani, who awarded her the country's first National Peace Award and a reward of £3,300 after she missed out on winning the International Children's Peace Prize for which she was nominated in 2011.

Recently she had spoken of her desire to set up her own political party and a vocational institute for marginalised girls in her area.

The attack led alarmed locals to raise doubts about government claims that the military has completely dismantled the militants' operation in Swat.

"An attack on Malala in a highly secured area has sent a shiver down the spine of Swati people," said Fazal Maula Zahid, a member of Swat Qaumi Jirga, a local anti-Taliban group working for peace in the region. "We are holding urgent meeting of our jirga [tribal assembly] to chalk out a future strategy. We demand of the government to arrest the attackers or the confidence of the people in the government will greatly be shaken."

Although Pakistanis have grown used to the horrors of Taliban bombings and attacks around the country, some media figures said the attempt on Yousafzai's life could be a watershed.

Murtaza Salangi, the director of Pakistan Radio, said people were standing up to be counted as if this was their own daughter.

"I think it is a watershed moment because the outpouring of sympathy and support for this young girl is just unprecedented. She could be a rallying poster for people who think that extremism and terrorism is the biggest challenge, even an existential challenge, for this country."

He said the mood of revulsion extended beyond just the "educated elite", saying the switchboard at Radio Pakistan's Peshawar studio had "lit up like Christmas lights" after phone lines were opened for people across the country to contact a phone-in programme.

Rana Jawad, Islamabad bureau chief of Geo, the country's biggest news channel, compared footage played throughout the day of the unconscious Malala being loaded on to a helicopter to a 2009 clip showing a woman in Swat being beaten by the Taliban, which was constantly replayed and horrified the country.

"The reason the military was successful in its campaign against the Taliban in 2009 is that the whole nation was supporting them after they watched a young girl being beaten by a handful of militants," he said. "Today we have seen the reaction of the people is one of outrage, revulsion and a sense of shame at what has happened to Pakistan."

Although he noted none of the country's religious conservative parties have yet condemned the attack, he said the Malala incident could "help the nation gel together in dismissing this mindset which attacked an innocent, harmless girl".

The country's supreme court on Tuesday ordered an investigation into the alleged barter of seven girls to settle a blood feud in a remote district.