Only 14, the rosy-cheeked Pakistani schoolgirl and women’s rights activist is a rare bright light in a country hobbled by violence and extremism.

A prediction she made to me a year ago was realized Tuesday afternoon when a Taliban gunman boarded a bus transporting children home from school in Pakistan’s volatile Swat Valley and demanded to know which one of the passengers was Yousafzai.

Another girl on the bus pointed to Yousafzai, and when she denied her identity, the gunman shot both girls. Yousafzai was shot in the head and in the neck. Photographs of the injured teenager on Monday showed her lying on a stretcher, covered in a blood-soaked white sheet.

After complicated surgery at a military base near Peshawar, doctors removed a bullet from her neck Tuesday.

During my tenure as the Toronto Star’s correspondent in South Asia, I met with Yousafzai and her father on four occasions, including two formal interviews. One time, we walked the maze of narrow streets of her hometown of Mingora, a city of 250,000 surrounded by persimmon and apricot orchards in the picturesque Swat Valley. Another evening, we laughed and talked about cricket over a dinner of barbecued kebabs and raita, a cooling yogurt side dish popular in South Asia.

I never had the chance to meet her mother, who by her own choice observed the Islamic practice of purdah, which calls for women in public to be hidden behind a screen and limits contact with male non-relatives.

“She supports me,” Yousafzai told me. “She says I am free to choose how to live my own life.”

I often cite Yousafzai in conversation with friends and readers, saying that so long as there are young Pakistanis like her, the battered country has cause for optimism. I use her pictures in a slide show I’ve featured when I speak to high school students about reporting abroad. Her photos and story are enough to make a classroom of teenagers forget about their iPods for a few minutes.

Even amid the tragedy of her shooting Tuesday, there was a glimmer of hope. As news of the incident spread through Mingora, several hundred residents went to the local hospital, offering to donate blood, a reminder Pakistan remains a country with a population of moderates and liberals.

For more than two years, in 2007 and 2008, Yousafzai’s hometown of Mingora was a base for Islamic militants. They routinely rounded up enemies — residents say 40 were targeted in one three-month period — dragged them to a local traffic circle near crowded bazaars and butcher shops, and cut off their heads.

To stoke more fear, the extremists placed their victim’s head on his chest and pinned a note warning the removal of the deceased before noon the next day would herald more beheadings.

Against this backdrop of terror, Yousafzai spoke out.

In September 2008, she travelled with her father Zia to Peshawar to speak to a press club.

“How dare the Taliban take away my basic right to education,” Yousafzai said in front of a packed room of journalists, some of them broadcasting live.

Looking into the cameras, she scolded the Taliban.

“You may stop me from going to school, but you will not stop me from learning,” she said.

Yousafzai met with me for the first time in October 2009 in the courtyard of the private school her father ran. She sat with her hands folded as a group of young boys wrote exams nearby and she spoke softly but confidently in English. She said she would never bow to the Taliban’s demands and explained how she hid her textbooks under her clothes while walking to school.

She also wrote an Internet blog under a pen name, highlighting the rights abuses occurring in Swat.

More than a year later, in January 2011, we sat down for another interview in Mingora.

“Education is not a gift for children, it should be their right,” Yousafzai said, “and hopefully, our country’s leaders will give us the rights we deserve. This is their responsibility.”

The then-13-year-old girl’s words sent chills up my spine. I was struck by how mature and fearless she was in a country where the promise of violence has prompted a culture of silence.

Yousafzai walked past a large government billboard that proclaimed a pledge to Swat: “You don’t have to worry about suicide bombing attacks . . . These bad days are not for ever. Every night has a morning.”

I asked Yousafzai and her father whether they felt Pakistan’s bad days had, indeed, passed.

She looked at the ground, shaking her head.

Her father Zia was slightly more optimistic. “Insha’Allah,” he said. “God willing.”

Zia Yousafzai told me how the Taliban took control of Mingora, a four-hour drive north of Islamabad.

“They didn’t show up one day with a Jeep with rocket launchers and machine guns,” he said.

A local religious leader named Mullah Fazlullah in 2004 began broadcasting sermons from his own radio station, “Radio Mullah.” Initially, Fazlullah merely discussed the tenets of Islam and ironically, he won support from local housewives who managed their household finances.

But it wasn’t long before Fazlullah’s message became more hardline.

Fazlullah, a former ski lift operator, demanded Mingora’s movie theatre close and called music and art secular evils. Polio vaccinations, he said, were a Western conspiracy, and he preached that women did not belong in schools or public markets. The Arab-style burqa with a slit to see through was no longer adequate for women; the Taliban insisted the Afghan “ghost-style” opaque screen be used instead.

Throughout Pakistan and neighbouring Afghanistan, women’s education has become a battleground for extremist Islamists and western governments that inject billions of dollars in aid money, especially for education because it’s a cause many western voters support.

In 2009, 15 female students and teachers in Kandahar, Afghanistan, were sprayed with acid by extremists who wanted women to stay at home. It was just one of many such attacks against women in the country.

Yet there has been a measure of progress. By this year, 40 per cent of Afghanistan’s students were female and 40,000 women were enrolled in public and private universities.

In a diary she kept for the BBC’s Urdu language service, Yousafzai wrote of life in Mingora under the Taliban.

“I had a terrible dream yesterday with military helicopters and the Taliban,” she wrote on Jan. 3, 2009. “My mother made me breakfast and I went off to school. I was afraid of going to school because the Taliban had issued an edict banning all girls from attending schools. Only 11 students attended the class out of 27. The number decreased because of the Taliban’s edict. My three friends have shifted to Peshawar, Lahore and Rawalpindi with their families after this edict.

“On my way from school to home I heard a man saying ‘I will kill you’. I hastened my pace and after a while I looked back (to see) if the man was still coming behind me. But to my utter relief he was talking on his mobile and must have been threatening someone else over the phone.”

In January 2011, I asked Yousafzai about that diary and whether her fear had subsided.

“Well,” she said. “The Taliban are gone from the police station and main bazaar, but you know they are still here. They are in shadows. They are waiting. I am not afraid. They may hate me and want me dead but I know my family supports me. And so do countries like yours.”