Shahzad Haidari doesn’t remember exactly how old he was – maybe 10, maybe 11 – when his father was killed by the Taliban. But in those months of grinding poverty that blurred together, his mother’s counsel rose in clarity: “Learn English. It is the only way we can come out of this,” she told him. “Seek knowledge from your birth until the grave.”

Those words, which today at age 16 he calls “speeches of gold,” guided him out of Afghanistan, after his house was set ablaze and his mother and two younger siblings disappeared. Just 12, he traversed deserts and rivers and countries, working in factories to pay the smugglers that moved him along on a harrowing journey, with a singular goal in mind: to attend school.

And those words were with him when he finally crossed the Austrian border around his 15th birthday, only to find out that the authorities weren’t obligated to educate him because compulsory schooling ends at age 15 in Austria. Instead of giving up, he set off on foot again, this time with a printed map he requested from the asylum center where he was living and the address of the Vienna board of education.

Throughout the entire ordeal, he says he was “scared, but I didn’t cry.” Until the day he received a phone call from an employee at the school board who had overheard his pleas, in the nearly flawless English he’d picked up on his trek, for an education.

To this day, he doesn’t know the name of the woman who called. But she gave him the address of his new school, where he entered eighth grade – the start of a new life. “I laid down in my bed,” he says. The past came rushing back. On that day, he thought of his mother and cried. “Her speeches saved my life.”

Melanie Stetson Freeman/Staff Shahzad Haidari (facing camera) eats dinner with his foster family in Vienna.

Europe has never experienced such an influx of children. Of the million asylum seekers who arrived last year, more than 25 percent are under age 18. Many of them have been uprooted with their families escaping war. Thousands of others, like Shahzad, are coming all by themselves, after losing parents or fleeing violence and poverty, sometimes braving the journey with the hope of reuniting with their parents later.

According to Eurostat, nearly 90,000 unaccompanied minors sought asylum in the bloc last year, up from 23,000 in 2014, and 12,000 the year before. The vast majority are boys. The risks they face are extreme: harsh climates, roaring rivers, flimsy boats, and when they are alone, exploitation of the worst kind. The psychological baggage they bring is well documented, showing, unsurprisingly, significantly higher rates of mental disorders and trauma.

Indeed, Shahzad’s story is remarkable – and his fortunes only got better as he enrolled in the peach-brick middle school and met his German language and literature teacher. Shahzad, whose name has been changed because his asylum application is still pending, says he feels so fortunate that sometimes he is ashamed. But if there is a larger hope to be found, it’s that children like him, despite experiencing war and harrowing hardship when they should have been dealing with eating their vegetables and doing their homework, show a strain of resilience that has surprised even the experts studying it.

Marieke Sleijpen, a researcher and psychologist in the Netherlands, adopted the term “bouncing forward” in her research on the fate of young refugees – because the idea of going back, or “bouncing back,” is impossible for most refugees, who may never go home, or if they do, find a home that’s no longer the same. While studying their trauma is important to help service providers give them the support they need, she says there is also a shift in research to emphasize the ways that young refugees are responding positively to adversity, and that even the diagnosis of mental disorders is being rethought.

“They are showing a normal reaction to abnormal circumstances,” she says. “Resilience can’t be an excuse for doing nothing for people in need. But for me it was very important that, while in the news the focus is on the helplessness, the sadness of young refugees, this [emphasizes] their dependence and inequality.... If you focus on their resilience, you give a new vision, give new pathways to work with these youngsters.”

Melanie Stetson Freeman/Staff Shahzad Haidari (not his real name) plays dress up with his foster sisters, Amelie (c.) and Nora Preis, in their playroom in Vienna.

The rush of children into Europe consists of two distinct waves. The first are the unaccompanied minors, who have caught authorities by surprise as their numbers have spiked in destination countries such as Sweden, Germany, and Austria. The other is the flow of women and children joining men who arrived before them, dramatically shifting the demographics of the refugee trail this year. In April, 34 percent of those arriving by sea were children, up from 16 percent in June 2015.

Sweden has been the most popular destination for kids coming alone, since its protection for minors has been the most robust. But most of these arrivals have not been Syrians. They have been boys from Afghanistan who left as the security situation there deteriorated through 2015, at the same time that information spread by word of mouth that Europe’s borders were open. Last year Sweden received more than half of all asylum applications from unaccompanied minors in Europe, with 35,369 cases. Of those, 23,480 were Afghan minors like Shahzad, compared with a total of 3,700 Syrian children.

“It was unprecedented,” says Anders Ryden, an Afghanistan expert at the Swedish Migration Agency. “I’ve never seen numbers like that.”

Not all the children are coming for purely innocent reasons. In some cases, families have made a decision to send a child alone to a European country in hopes of bolstering the chances of the parents being admitted later. Minors receive more benefits than adults and tend to file their applications as unaccompanied minors in the countries with the least restrictive reunification policies. For this reason, some young people claim they are 16 or 17 when, in fact, they are 18 or older. Many countries, as a result, are taking steps to “age test” the young arrivals. It is important, says Demetrios Papademetriou, president emeritus of the Migration Policy Institute in Washington, for host countries to understand that families will try to “test and exploit what they see as a weakness in system.”

No matter what their motive for fleeing, the number of young refugees is overwhelming service providers across Europe. Countries are being forced to hire more teachers and find suitable guardians to watch children who need costly, 24-hour care. “There is a glaring gap between unaccompanied children that arrive and the number of guardians available,” says Hanne Beirens, associate director of the Migration Policy Institute Europe.

The risks were underscored by Europol, which said in January that at least 10,000 unaccompanied minors in Europe who registered with authorities are now “missing.” Some of them may have linked up with families. Others leave shelters to try to find work. But many, Europol warns, may have fallen into the hands of sex traffickers or child-labor brokers.

Melanie Stetson Freeman/Staff Shahzad rides a trolley to his German class. Axel Petri-Preis, one of Shahzad’s teachers, took the Afghan youth in as a foster child. Shahzad has lived with the family since late 2015.

Shahzad’s journey to a new life was a circuitous one – and fraught with heart-rending experiences. He says life in a village outside Kabul was good before his father was killed. But his mother and siblings struggled afterward, as the family feuded with relatives who were Taliban. He kept up with his studies, though he had to help the family by doing odd jobs. One day as he was walking home his cousin stopped him in the street and told him his house was burning and his mother, little brother, and sister were gone. “If you go [back], you will get killed, too,” Shahzad says his cousin told him. “That was the start of my journey.”

Shahzad fled to Kabul. He was barely a teenager at the time. He says he lived like a homeless person because there were no organizations in Kabul to help underage kids. He sold gum on the streets and then found work cleaning floors at a photography studio. He saved as much money as he could. Eventually, he and a group of other orphaned boys paid smugglers to spirit them out of the country. “We wanted to go to Iran,” he says. “There was no hope in Afghanistan.”

They trekked for seven days over deserts and mountains. The smugglers found them a job at a factory in Iran that makes backpacks and other bags. For the first month, the plant bosses took half of his pay. “The people were really cruel,” he says. “We worked from 8 a.m. to 8 at night, and only two times a day were we given food, just the morning and evening.”

After nine months of working excessive hours and little humane treatment, and with his mother’s admonition about education on his mind, he and some other Afghan youths found a smuggler and set off for Turkey.

Turkey turned out to be more hospitable than Iran. “I had nice friends,” Shahzad says. “It was not good work for a teenager, but I could earn good money.” He labored in an ice-cream factory. Later he ironed shirts.

But he still wasn’t going to school. So after 10 months, he set off for Western Europe via Serbia. While crossing through with other refugees, the group came to a frozen river. They had to cross, but the ice didn’t hold their weight. “Too many passed at the same time, and we fell through the ice,” he says. “When I got out, my clothes became frozen to my body.”

“I saw a person who said, ‘Leave me here because I know I’m dying,’ ” he continues. “The smuggler said, ‘C’mon ... keep walking.’ ” The man survived.

Shahzad had an idea where he wanted to end up. He had friends who had made it to Britain, Germany, and Sweden. But, having experienced too much war, he wanted to go to a place that, based on some Internet research and his own imagination, wouldn’t have a propensity for conflict. He liked Switzerland and Austria, finally settling in Vienna. “All the people are really nice here,” he says. “I’m really lucky right now.”

When Shahzad started school last September, he was living in a cramped asylum center in the city. For a boy who once made backpacks, he could barely believe his good fortune to be carrying one. Still, he had no privacy, or place to study, and his troubles mounted.

His teacher, Axel Petri-Preis, a youthful 35-year-old with a calm manner and soothing voice, took notice of him. Shahzad had almost no school supplies. His shoes were shabby. So Mr. Petri-Preis took him shopping for new clothes, and invited him home to dinner with his wife, Barbara Preis, and their two little girls, Nora and Amelie, ages 3 and 5. Even before they met Shahzad, the couple knew they wanted to play a role in Europe’s refugee crisis that went beyond just donating money.

“At first it was every second week, then every weekend,” Petri-Preis says of his invitations. The situation at the asylum center deteriorated. Someone stole Shahzad’s new clothes. Petri-Preis invited him to sleep over one night, then two. “And I don’t know, one thing led to another,” he says in his living room, popping up from the couch occasionally to stir a pasta sauce. “There was a point of time in mid-November when my wife and I said, ‘We need to make a decision now. Do we want to take him or send him back [to the asylum center]?’ And we really couldn’t send him back.”

The couple formally became his foster parents on Dec. 3. They drew up a list of what was most important to them, and what was expected of Shahzad. They told him they weren’t religious, and in fact are quite critical of many aspects of Islam, something he’d have to understand even though he was raised Muslim and turns to Allah in his times of need. They talked about equality between the sexes – in their home, Petri-Preis hyphenated his own last name with his wife’s – and what the rules were in dealing with girls. They told him that he is expected to act like a member of the family, no longer just a guest. That means taking out garbage, attending all family events, and coming home when expected, which he doesn’t always do.

“I get really mad at him sometimes,” says Petri-Preis. “Apart from everything he’s been through, he’s still a 16-year-old boy.”

On a recent evening, Shahzad is doing his homework in his own bedroom in front of a desktop computer. His sisters are getting a bath, the littler one howling because she hates to be dried off. But under a placid surface, a major shift is taking place. It took the couple’s 5-year-old time to adjust. “She loved him, then hated him. She asked always, ‘When is he going back to Afghanistan?’ ” Ms. Preis says. She, in the meantime, wondered about her own role as foster mother. “I was struggling with the fact that I’m not really his mother,” she says. Now, she adds, “I treat him like my own child.”

Both parents also know there is much pain yet to be resolved. Petri-Preis says Shahzad is still in “survivor mode.” While the basic facts of his past are known, Petri-Preis says, the details can be fuzzy. Shahzad says it’s too hard for him to think about the past, so he avoids it. Preis worries about whether she’ll be capable of helping him deal with trauma when the time comes. Sometimes he has bad dreams. Shahzad says he prays when he has bad feelings. Other times he calls for his foster mom and says his head hurts. She knows then that something is bothering him, so they talk.

• • •

Across town, at an asylum center for unaccompanied minors run by the Roman Catholic charity Caritas in Vienna, the 45 boys living there don’t have a parent to call when they need help. In Austria, 88,180 asylum applications were filed last year, nearly a third by minors. One-third of those traveled here alone.

On this day, the boys eat the food they’ve cooked – they are responsible for preparing it – or watch videos on smartphones. One Syrian named Muhammed sits with a local doctor who is giving him German lessons. The doctor uses a child’s push-toy car to teach the youth automotive vocabulary.

Another teen, Abdelhak, has come from Algeria and acts tough when asked if he misses his mother and siblings at home. “I can wait,” he says. His plan is to get refugee status and bring them over.

Many of the children under Caritas’s care don’t want psychological treatment because they think it’s something for crazy people. What they want is to go to school. But many of them can’t even read or write in their native languages, says Kristina Yakovlev, the head of the center. Many of them feel enormous pressure. In some instances, families have sold their homes or gone deep into debt to pay for their sons’ passages. “They ask every day, ‘when can I get a place at school?’ They all want to study,” she says. “Only a very few will have a good chance for a good education.”

That’s true even when they have their parents to lobby for them, says Sibylle Hamann, a journalist in Austria who works with a half-dozen families from Syria recently arrived in Vienna. In a two-pronged system starting in middle school, many refugees will get channeled into the vocational educational program, instead of university prep, as Shahzad was able to do, she says. It’s something that refugee parents are already thinking about.

Melanie Stetson Freeman/Staff Shahzad does homework in his bedroom. He was determined to get into a good school once he arrived in Vienna.

Shahzad sits in his bedroom in his new home in his new country. It has now been more than a year since he arrived in Europe, six months since he started school, and four since he became part of the Preis family.

His life has taken on something of a normal rhythm. He plays billiards and bowls with his best friend, an Iranian asylum seeker, on the weekends and loves James Bond and Justin Bieber. He even has the latest trendy teen hairstyle – tight-cropped on the sides with a pompadour on top. He says that when he first arrived, an Austrian girl asked him his name and he had to fight the urge to run away, since Afghan boys didn’t play with Afghan girls. Now he has plenty of friends who are girls. He even has a girlfriend.

He also has a new goal. He wants to be a pilot. On career day at school, he got to sit in an aircraft for the first time – he says, eagerly sharing photos of the cockpit – though he has yet to actually fly. “You have to be a kind of genius to become a pilot in Austria,” he says. He’s not sure whether his trek, almost entirely on foot, from Afghanistan to Austria, seeded his desire. But, he says, without a note of irony, “It’s really hard for a man to walk from Afghanistan to here, to walk from one continent to another continent. I think let’s make the journey for people easy.”

He says he feels ashamed about what he’s been given because for four years he was responsible for himself. Now he has a closet full of new clothes. On Jan. 1, he turned 16. It’s the first time he ever celebrated his birthday. “They gave me too many presents,” he says. “They really love me so much.”

He talks of finally feeling free of the past. “I’m not going to lose them, even when I am 18 or 20, I will always have them,” he says of his new family. “All fear has vanished.”

Except for one. When he thought he was going to freeze to death on the journey here, he said he had a last wish – time to be able to find his mother.

His foster parents took him to register at the Red Cross in Austria so officials can find him if there is word about his family in Afghanistan. He hasn’t been in contact with anyone from his home country, except for one friend who knew nothing about his mother’s fate.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

“My only fear is that somebody calls me and says, ‘I’m sorry but your mother is no longer alive.’ ”

“My mother really loved me. She worked all the time for me when I lost my father, and didn’t let me lose my studies,” he says. “Because of that, I am here.”