A Taliban gunman walked up to a bus taking children home from school in Pakistan's volatile Swat Valley on Tuesday and shot and wounded a 14-year-old activist known for championing the education of girls and publicizing atrocities committed by the Taliban, officials said.

The attack in the city of Mingora targeted 14-year-old Malala Yousufzai, who is widely respected for her work to promote the schooling of girls -- something that the Taliban strongly opposes. She was nominated last year for the International Children's Peace Prize.

The Taliban claimed responsibility for the attack, calling Malala's work "obscenity."

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

The school bus was about to leave the school grounds in Mingora when a bearded man approached it and asked which one of the girls was Malala, said Rasool Shah, the police chief in the town. 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.

Malala was shot twice -- once in the head and once in the neck -- but her wounds were not life-threatening, said Tariq Mohammad, a doctor at the main hospital in Mingora. The second girl shot was in stable condition, the doctor said. Pakistani television showed pictures of Malala being taken by helicopter to a military hospital in the frontier city of Peshawar.

In the past, the Taliban has threatened Malala and her family for her activism. When she was only 11 years old, she began writing a blog under a pseudonym for the BBC's Urdu service about life under Taliban occupation. After the Taliban were ejected from the Swat Valley in the summer of 2009, she began speaking out publicly about the militant group and the need for girls' education.

While chairing a session of 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."

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. It was a reminder of the challenges the government faces in keeping the area free of militant influence.

The scenic valley -- nicknamed the Switzerland of Pakistan -- was once a popular tourist destination for Pakistanis, and honeymooners used to vacation in the numerous hotels dotted along the river running through Swat. 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 Swat in 2007 -- part of a wave of Al Qaeda and Taliban fighters expanding their reach from safe havens near the Afghan border. By 2008 they controlled much of the valley and began meting out their own brand of justice.

They forced men to grow beards, restricted women from going to the bazaar, whipped women they considered immoral and beheaded opponents.

During the roughly two years of their rule, Taliban in the region destroyed around 200 schools. Most were girls' institutions, though some prominent boys' schools were struck as well.

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, their 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, praised Malala for standing up to the militants and sending a message across the world that Pakistani girls had the courage to 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 also the focus of a separate case before the high court, which ordered a probe into an alleged barter of seven girls to settle a blood feud in a remote southwestern district. Such feuds in Pakistan's tribal areas often arise from disputes between families or tribes and can last generations.

Chief Justice Iftikhar Chaudhry began proceedings into the allegations, which were first reported in the local media. The alleged trade happened in the Dera Bugti district of Baluchistan province between two groups within the Bugti tribe, one of the more prominent in the province.

A tribal council ordered the barter in early September, 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.

However, the Advocate General for the province could not confirm the incident.

Chaudhry, the chief justice, ordered Faisal to ensure that all members of the tribal council appear in court on Wednesday, as well as a local lawmaker who belongs to one of the two sub-tribes believed involved in the incident.

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.