Dion Leonard noticed the pup, soon nicknamed Gobi, scampering alongside a group of American runners.
It's still unclear how or why the scrappy, apricot-colored dog with pointy ears showed up to the starting line of the 155-mile ultramarathon in June. The closest village was several miles away, and all that lay ahead was the vast, unforgiving Gobi Desert.
Dion Leonard, a distance runner from Scotland, noticed the pup scampering alongside a group of American runners, but didn't think she would last long - much less through most of the six stages of a grueling, week-long endurance race.
Until she reappeared by his side at the start line on the morning of Day 2.
"This little dog's sort of sitting next to me, looking up like, 'Are we going to run together today?'" Leonard told The Washington Post. "I didn't really think that much of it. I thought, let's see how long this dog lasts."
The dog, whom he soon nicknamed Gobi, followed him through all 23 miles that day, climbing nearly 20,000 feet in elevation as they crossed the Tian Shan range and journeyed into the Gobi Desert. At times, she would charge ahead of Leonard, motivating him to run faster. At other points, he stopped to give her beef jerky and water from his own pack.
At their campsite that night, Gobi lay down next to him in his sleeping pad, wedging herself against his armpit to snuggle.
"She literally stayed with me all day," said Leonard, 41, an Edinburgh resident who has competed in numerous multistage ultramarathons.
It's still a mystery why Gobi followed him, of all the 101 competitors in this year's Gobi March. "I didn't do anything in particular to gain her attention. She chose me. I was the one that she was going to stick to."
Over Day 3, Gobi continued to follow Leonard, this time over increasingly harsh terrain. Leonard picked her up and carried her over multiple river crossings up to 21 yards long, with rushing water up to his stomach.
"I started to realize then that we were really close," he said. "I wasn't going to leave her behind."
In all, Leonard estimates Gobi accompanied him for 105 miles of the seven-day race, through stages 2, 3 and 6. Because of the heat - temperatures peaked around 125 degrees Fahrenheit around the middle of the course - Gobi wasn't allowed to run stages 4 and 5.
However, race organizers drove her to the finish lines on those days, where she waited faithfully for Leonard to cross.
"Day 5 is actually 80 kilometers. You're obviously pretty tired. It's a big day. It's very hot," he said. "To come in to the finish line and to see her wagging her tail . . . was just amazing."
Ultimately, Leonard took second place in the race. At the final finish line, event organizers produced a matching medal for Gobi, too.
By then, he knew they shared a special, inexplicable bond. Leonard began researching what it would take to bring Gobi back to the United Kingdom: a host of medical examinations, paperwork and quarantines, at a cost of more than $6,500.
He and his wife started a crowdfunding campaign online. Within days, it surpassed its fundraising goal, attracting donations from all over the world.
"We're really thankful," he said. "I think everyone's been keen to seeing good news."
He doesn't know Gobi's age, breed or medical history - just that they now are incomprehensibly connected. Leonard has since returned to Scotland and estimates that the process for Gobi to make it to the U.K. could take up to four months.
"We're looking at having her here for Christmas in an ideal world," he said. His wife is thrilled. Their cat remains unaware she will be getting a "sister" soon, Leonard said.
While they wait, Leonard is preparing for his next ultramarathon in October, a similar 155-mile trek across the Atacama Desert in Chile that, like the Gobi March, is part of the 4 Deserts Race Series.
"I'm hoping a horse or an alpaca doesn't follow me there," he said, laughing. "I may not get away with bringing that back."
© 2016 The Washington Post