MINGORA, Pakistan -- Fourteen-year-old Malala Yousufzai was admired across a battle-scarred region of Pakistan for exposing the Taliban's atrocities and advocating for girls' education in the face of religious extremists. On Tuesday, the Taliban nearly killed her to quiet her message.

A gunman walked up to a bus taking children home from school in the volatile northern Swat Valley and shot Malala in the head and neck. Another girl on the bus was also wounded.

The young activist was airlifted by helicopter to a military hospital in the frontier city of Peshawar. A doctor in the city of Mingora, Tariq Mohammad, said her wounds weren't life-threatening, but a provincial information minister said after a medical board examined the girl that the next few days would be crucial.

Malala began writing a blog when she was just 11 under the pseudonym Gul Makai for the BBC about life under the Taliban, and began speaking out publicly in 2009 about the need for girls' education – which the Taliban strongly opposes. The extremist movement was quick to claim responsibility for shooting her.

"This was a new chapter of obscenity, and we have to finish this chapter," Taliban spokesman Ahsanullah Ahsan by telephone.

The shooting provoked outrage across the country, angering Pakistanis who have seen a succession of stories about violence against women by the Taliban.

"This attack cannot scare us nor the courageous Malala. This cowardly act cannot deter Malala to give up her efforts," said Azizul Hasan, one of the girl's cousins.

Prime Minister Raja Pervaiz Ashraf condemned the attack and called her a daughter of Pakistan. State Department spokeswoman Victoria Nuland called the shooting "barbaric" and "cowardly."

Leila Zerrougui, the U.N. special representative for children in armed conflict, condemned the attack "in the harshest terms." "Education is a fundamental right for all children," she said in a statement. The Taliban "must respect the right to education of all children, including girls, to go to school and live in peace."

The attack displayed the viciousness of Islamic militants in the Swat Valley, where the military conducted a major operation in 2009 to clear out insurgents, and a reminder of the challenges the government faces in keeping the area free of militant influence.

In her BBC blog, Malala wrote about not wearing her uniform to school after officials warned it might attract the Taliban's attention, and how many other students moved out of the valley after the Taliban issued an edict banning girls from school. She wrote about the Taliban movement had kept her family from going out after sunset.

While chairing a children's assembly supported by UNICEF in the valley last year, the then-13-year-old championed a greater role for young people.

"Girl members play an active role," she said, according to an article on the U.N. organization's website. "We have highlighted important issues concerning children, especially promoting girls' education in Swat."

She was nominated last year for the International Children's Peace Prize, which is organized by the Dutch organization KidsRights to highlight the work of children around the world.

Malala was shot on her way home from a school run by her father, Ziauddin, who is also known in the valley for promoting education of girls.

The bus was about to leave the school grounds in Mingora, the largest city in Swat Valley, when a bearded man approached it and asked which one of the girls was Malala, said Rasool Shah, Mingora's police chief. Another girl pointed to Malala, but the activist denied it was her and the gunmen then shot both of the girls, the police chief said.

The Swat Valley – nicknamed the Switzerland of Pakistan – was once a popular tourist destination for Pakistanis. Honeymooners used to vacation in the numerous hotels dotted along the river of the same name running through it. But the Taliban's near-total takeover of the valley just 175 miles (280 kilometers) from the capital in 2008 shocked many Pakistanis, who considered militancy to be a far-away problem in Afghanistan or Pakistan's rugged tribal regions.

Militants began asserting their influence in the valley in 2007 – part of a wave of al-Qaida and Taliban fighters expanding their reach from safe havens near the Afghan border.

By 2008 they controlled much of it and began meting out rules and their own brand of justice. During about two years of its rule, the Taliban forced men to grow beards, restricted women from going to the bazaar, whipped women they considered immoral and beheaded opponents.

Taliban militants in the region also destroyed around 200 schools. Most were girls' institutions, though some prominent boys' schools were struck as well. The private school owned and operated by Malala's father was temporarily closed under the Taliban.

At one point, the Taliban said they were halting female education, a move that echoed their militant brethren in neighboring Afghanistan who during their rule barred girls from attending school.

While the Pakistani military managed to flush out the insurgents during the military operation, the Taliban's top leadership escaped, leaving many of the valley's residents on edge.

Kamila Hayat, a senior official of the Human Rights Commission of Pakistan, said Malala's activism sent a global message that Pakistani girls could fight for their rights. But she also worried that Tuesday's shooting would prevent other parents from letting their children speak out against the Taliban.

"This is an attack to silence courage through a bullet," Hayat said. "These are the forces who want to take us to the dark ages."

The problems of young women in Pakistan were the focus of a separate case before the high court, which ordered a probe Tuesday into an alleged barter of seven girls to settle a blood feud in a remote southwestern district. The tradition of families exchanging unmarried girls to settle feuds is banned under Pakistani law but still practiced in the country's more conservative, tribal areas.

A tribal council ordered the barter in early September in the Dera Bugti district of Baluchistan province, the district deputy commissioner, Saeed Faisal, told the court. He did not know the girls' ages but local media reported they were between 4 and 13 years old.

The Advocate General for the province could not confirm the incident.

Chief Justice Iftikhar Chaudhry ordered Faisal to ensure that all members of the tribal council – and a local lawmaker – who belongs to one of the groups believed involved – appear in court on Wednesday.

___

Santana reported from Islamabad. Associated Press writer Abdul Sattar in Quetta and Zarar Khan and Asif Shahzad in Islamabad contributed to this report.

Also on HuffPost:

Loading Slideshow...
  • Iraq

    Iraqi police women march during a parade to mark 90 years since its foundation in the Iraqi capital Baghdad, on January 9, 2012. The force, which has apologised for acts committed during the rule of now-executed dictator Saddam Hussein, held ceremonies in major cities across Iraq. (AHMAD AL-RUBAYE/AFP/Getty Images)

  • Iran

    Iranian policewomen parade during a female police graduation ceremony at the Police Academy in Tehran, 11 March 2006. (ATTA KENARE/AFP/Getty Images)

  • Afghanistan

    An Afghan police woman listens to the instructions of a German police woman inside the Police Training Center on June 14, 2010, in Kunduz, Afghanistan. German police women train a class of Afghan police women during a two-week education program. (Photo by Miguel Villagran/Getty Images)

  • Pakistan

    Pakistani policewomen stand alert on a street in Karachi on February 26, 2010, on the eve of Eid-e-Milad-un-Nabi, the birth anniversary of holy Prophet Mohammad. Muslims across Pakistan will celebrate the birth of the Prophet Mohammed on February 27. (RIZWAN TABASSUM/AFP/Getty Images)

  • India

    Indian policewomen salute in remembrance of fallen colleagues during a Police Commemoration Day ceremony on the outskirts of Srinagar on October, 21, 2011. (ROUF BHAT/AFP/Getty Images)

  • Bahrain

    Bahraini policewomen stand guard at the Bahrain International Formula One circuit during the first free practice session 02 April 2004. 'Gulf Air' is the official sponsor of the Bahrain Formula One race, the first in the Middle East, which takes place on 04 April 2004. (ADAM JAN/AFP/Getty Images)

  • Jordan

    Jordanian policewomen are put through their paces at an academy in the town of al-Muwaqr, some 70 kilometres, from Amman on August 21, 2008. The academy was recently established and trains both female and male police officers from all over Jordan. The Iraqi, Palestinian and Afghanistan police are also trained here. (AWAD AWAD/AFP/Getty Images)

  • Turkey

    Turkish policewoman stands guard outside the Beyiazid Mosque on November 30, 2006 in Istanbul, Turkey. (Photo by Carsten Koall/Getty Images)

  • Yemen

    A fully veiled Yemeni policewoman shows her colleague how to shoot a hand-held gun during an internal competition in shooting at the Yemeni police academy in Sanaa on January 26, 2010. (MARWAN NAAMANI/AFP/Getty Images)

  • Gaza

    Hamas policewomen march during a graduation ceremony at the Arafat police academy on October 30, 2008 in Gaza City. (MAHMUD HAMS/AFP/Getty Images)

  • Qatar

    Qatari policewomen take part in a military parade during the Gulf emirate's National Day celebrations in Doha on December 18, 2009. (KARIM JAAFAR/AFP/Getty Images)