BERLIN, Aug 2 — Yusra Mardini, an Olympic swimmer, was an hour and a half into her first training session of the day, butterfly-kicking down the length of a pool with a yellow rubber duck balanced on her head.

Other young swimmers shared the lane, but Mardini, 18, kept her own pace, darting down the centre, emerging at the edge of the pool from time to time to exchange the duck — used for balance training — for a snorkel or a kickboard.

Mardini has been practicing since October at the training centre for Wasserfreunde Spandau 04, one of the oldest swimming clubs in the city. The pool was built by the Nazis for the 1936 Olympics.

Everything about Mardini’s route to the Rio de Janeiro Games has been unlikely. She will compete on the first refugee team at an Olympics, a feat that was unthinkable less than a year ago when she was neck-deep in the Mediterranean Sea swimming for her life.

Last August, Mardini and her sister Sarah fled war-torn Syria and embarked on a harrowing, monthlong journey through Lebanon, Turkey, and Greece, up through the Balkans and Central Europe to Germany, narrowly dodging capture and death. When their crammed dinghy broke down between Turkey and Greece, she and her sister, also a swimmer, jumped into the water and helped guide the boat to safety.

Mardini’s story came to public attention in March when she was identified by the International Olympic Committee as a candidate to compete on a new team of refugees, made up of athletes who are stateless or would otherwise be excluded from the games. She was thrust into the spotlight, celebrated by the news media as a fresh-faced example of Germany’s so-called welcome culture — a story of uplift at the centre of the global refugee crisis.

Mardini was officially named to the refugee team in June along with nine athletes from Syria, South Sudan, the Democratic Republic of Congo and Ethiopia. The team will compete under the Olympic flag and anthem, entering the Maracanã stadium on Friday for the opening ceremony next to last, just before host Brazil. Mardini will compete in the 100-meter freestyle and the 100-meter butterfly.

“It’s going to be really cool,” she said, throwing a hot-pink Nike backpack onto a table in the cafeteria of the training centre.

She had found out a few weeks earlier that she had made the Olympic team from a group of journalists who had come to the apartment where she now lives with her sister.

“Because actually I never open my emails,” Mardini said. Then, she said, the journalists told her that a friend of hers, Rami Anis, also a Syrian swimmer, had made the team as well: “That’s when it was like, Ahh!”

Mardini had changed into a zip-up hooded sweatshirt (a gift from the German swimwear brand Arena) and blow-dried her hair into shimmery, past-the-shoulder layers. In each ear she wore two studs: a pearl and a rhinestone.

Mardini swings between frenetic, uncontainable excitement and half-bored preoccupation. She sends text messages frequently. In other words, she is a normal teenager.

“When I was a little kid, I was just put into the water,” said Mardini, who grew up in the Darayya suburb of Damascus. Her father, a swimming coach, began training her when she was three. Mardini went on to compete for the Syrian national team and received support from the Syrian Olympic Committee.

But then war broke out in 2011, when she was 13, and Mardini saw her relatively idyllic life begin to transform.

“All the sudden you couldn’t go where you wanted, or your mom calls you when you’re on your way and says, ‘Come back, there’s something happening there,'” she said. School would be cancelled for several days. “Or someone is shooting and then you have to run.”

On August 12, 2015, Mardini and her sister left with two of their father’s cousins and another friend. They flew from Damascus to Beirut to Istanbul, where they connected with smugglers and a group of about 30 refugees with whom they stayed for the duration of the journey.

The group was bussed to Izmir, Turkey, and then taken to a wooded area near the seaside to wait to board a boat to the Greek island Lesbos.

After four days, Mardini and her sister were packed with 18 other people, including a six-year-old boy, on a dinghy meant to accommodate six. On their first attempt, they were caught by border agents and sent back. On their second, the engine died after about 20 minutes, and the dinghy took on water.

Of the 20 people on board, only the Mardini sisters and two young men knew how to swim, so the four of them jumped overboard. It was about seven at night, and the turning tide had made the sea harsh and choppy.

“Everyone was praying,” Mardini said. “We were calling the Turkish police, the Greek police, saying: ‘Please, please help us. We have children! We are drowning!’ And they just kept saying, ‘Turn and go back. Turn and go back.'”

Mardini and her sister swam for three-and-a-half hours, helping the boat stay on course — even when the two male swimmers gave up and let the dinghy pull them along. It was cold, Mardini said. Her clothes dragged her down, and salt burned her eyes and skin.

“I’m thinking, what? I’m a swimmer, and I’m going to die in the water in the end?” she said. But she was determined to keep a good attitude — and not just for her own sake.

“The little kid kept looking at me, scared,” she said, “so I was doing all these funny faces.”

Eventually the boat made it to shore in Lesbos, but the journey was only beginning. The people in the group walked for days at a time, sleeping in fields or churches. Even though they had money, taxis refused to stop for them, and restaurants often refused them service.

“But there were good people, too,” she said. “When I arrived, I didn’t have any shoes, and there was a Greek girl — I think, the same age as me — and she saw us and gave us a pullover for the young kid, and she gave me her shoes.”

Eventually they made it out of Hungary, travelling through Austria and finally to Germany, where they ended up in a refugee camp in Berlin sharing a tent with six men they had travelled with.

“I was happy!” Mardini said, adding: “I don’t have any problems. I’m in Germany. I have my sister. That’s it.”

An Egyptian interpreter who helped out frequently at the refugee camp connected Mardini with nearby Wasserfreunde Spandau, and Sven Spannekrebs, a longtime trainer for the club, agreed to give her a tryout. When he saw Mardini swim, Spannekrebs said, he was impressed.

“The technical foundation was really good,” said Spannekrebs, who joined Mardini in the cafeteria for lunch after her morning swim. “After two years without training, it was just that the aerobic foundation was not good. Her body was in bad shape.”

“I was not that bad!” Mardini said, dropping her cutlery in protest. He shot her an exaggerated look of incredulity. She grinned and conceded: “OK, 25 days eating Burger King and McDonald’s.”

Not long after he started training Mardini, Spannekrebs became convinced she could be a candidate for the 2020 Tokyo Olympics. But when they learned the International Olympic Committee might be building a refugee team, he and Mardini realised her Olympic dreams could come true sooner than expected. In January, the committee granted her a training scholarship, and Spannekrebs started Mardini on a rigorous daily schedule: two two-hour sessions in the water and another hour of dry-land aerobic training, with school sessions in between.

“She’s a really tough athlete,” he said.

A medal in Rio is out of reach. Mardini’s fastest times are one minute eight seconds in the 100-meter butterfly and 1:02 in the 100-meter freestyle, a good nine and 11 seconds behind the official Olympic qualifying times for those events.

“I’m expecting personal best,” Mardini said.

Mardini used some of the scholarship money to get an apartment with her sister not too far from the training centre. Her parents and her two younger sisters have now joined them in Berlin, and the whole family has been granted temporary asylum.

Mardini posts selfies and inspirational quotations in Arabic and English on her Facebook fan page and on Instagram. She said she was looking forward to meeting some of her favourite athletes in Rio, particularly her childhood idol, Michael Phelps.

Mardini said she would like to use the attention she had received to help other refugees. Eventually she hopes to return to Syria to share her story with people there.

“I remember everything, of course,” she said. “I never forget. But it’s the thing that’s pushing me actually to do more and more.”

She added, “Crying in the corner, that’s just not me.” — The New York Times