Keflezighi could sense how desperately these fans wanted an American to win a year after those bombings. He’d spent much of the last half-hour running so far in front that his closest competitors could barely see him. Glancing over his shoulder at the 23-mile mark, however, he saw the orange blur of Kenyan Wilson Chebet gaining ground.

On April 21, one hundred minutes into the running of the 118th Boston Marathon, something incredible passed before fans at the 21-mile mark: an American in the lead. The very sight—of Meb Keflezighi out front in a race that no American man had won since 1983—induced mania in a crowd that had gathered to celebrate U.S. resilience. A year earlier, two terrorists’ bombs had turned the Boston Marathon deadly.

Less known still is how Keflezighi—who balances running with raising three young daughters with his wife, Yordanos—is managing to peak at an age when most marathoners have retired. Unlike many of his peers, he trains alone. In recent days, he offered a glimpse inside his training regimen.

As elite American athletes go, Keflezighi remains obscure. At the London Olympics, the announcer introducing America’s fleet of marathoners forgot to include Keflezighi. He is also underestimated. Before the London Olympics, Keflezighi’s longtime sponsor, Nike, declined to renew his contract.

Yet Keflezighi may be America’s most dangerous underdog. Before winning Boston in April—a feat virtually nobody saw coming—he finished fourth at the 2012 Olympics, the highest finish by an American male since Keflezighi took silver at the 2004 Olympics.

On Nov. 2, Keflezighi will attempt to become the first American since 1982 to win the New York and Boston marathons in the same year. Hardly anyone expects him to succeed. In New York, the site of some of his best races, he will compete against at least 10 runners who have finished marathons faster—in some cases much faster—than he has. He is 39, and nobody that old has won the New York City Marathon.

A mile later, Chebet had pulled within 25 meters. The dream of an American winning for the first time in three decades on the most important day in the country’s marathon history was in danger of slipping away. But it didn’t.

Chebet looked to be about 100 meters behind. “To feel better I told myself that if Wilson was feeling really good, he would be next to me by now,” Keflezighi recalls. “Then I hit the 24-mile mark and I felt like throwing up.”

At 28, Chebet was 10 years younger than Keflezighi. He had broken 2 hours 6 minutes in multiple races. Keflezighi had never broken 2:09. Keflezighi thought of slowing down and letting Chebet catch him. It might salvage energy for a sprint to the finish on Boylston Street, he thought. But catching up might inspire Chebet to blaze ahead. “Maintain the gap,” Keflezighi told himself.

Keflezighi has never failed a drug test and has long supported a lifetime suspension for a single performance-enhancing drug violation. But in a sport where many athletes have tested positive for PEDs, late-career heroics such as his inevitably raise eyebrows. He understands the questions.

Keflezighi lined up a new shoe sponsor, California-based Skechers. A year later, he won the U.S. Olympic trials marathon, outrunning favorites such as Ryan Hall. At the London Games, he finished fourth behind a Ugandan and two Kenyans after getting sick in the middle of the race.

In 2010, injuries sidelined him. When Keflezighi asked Nike to extend his contract through the 2012 Olympics, it dropped him. At 35, Keflezighi appeared to be finished. A Nike spokesman declined to comment.

In 1987, the family arrived in San Diego, when Keflezighi was 12. Only Keflezighi’s father spoke English. They had little more than the clothes they wore. Keflezighi wasn’t a runner back in Eritrea; his speed was discovered in a 7th-grade gym class shortly after he arrived in San Diego. A state champion in track and cross-country, Keflezighi won a full scholarship to UCLA. National championships, a silver medal at the Athens Olympics and a victory in the 2009 New York City Marathon would follow.

His late-career surge may be more stunning than his transformation from a shy, undernourished refugee into an elite athlete. Meb Keflezighi’s journey started in a village with no electricity or running water in war-torn Eritrea. In 1981, in the middle of the 30-year war between Ethiopia and Eritrea, Keflezighi’s father dodged Ethiopian soldiers, bandits and hyenas on a 225-mile trek to safety in Sudan. He immigrated to Italy, where he worked for 3½ years to earn enough to send for his family and begin the arduous approval process for moving to the U.S.

“Can people be skeptical?” he says over a plate of French toast in a cafe a block from San Diego’s Mission Beach. “They can. But I’ve been in this sport for 24 years. Look at my times.” He rattles off all his marathon finishes to the second. When he is healthy, he explains, his results fall within about 90 seconds of each other. “I’m skeptical when I see people who have the big fluctuations,” he says.

To some, elite marathoning is simply a collection of frighteningly lean bodies bounding as fast as they can for as long as they can. “My strategy is to go out…and win the race, no matter the distance or place,” explains Lelisa Desisa, the 2013 Boston Marathon champion from Ethiopia.

But on any given day, even the fastest marathoners can’t be sure their bodies and minds will maintain a brutal pace for 26.2 miles. Fear of hitting the wall in the final miles tempers their pace, making for a 130-minute chess match over whether to surge ahead or sit with the pack. For a 39-year-old who has never run faster than 2:08:37—more than five minutes slower than the world record—those decisions are the difference between winning and fifth place.

“Meb knows it’s not the time but the tactics,” says Bob Larsen, Keflezighi’s college coach and running guru ever since.

Keflezighi essentially coaches himself now, forming his own strategy and following it largely alone, using little more than his instincts. He has no set regimen. The plan is mostly in his head.

There are a few overriding themes. Unlike many elite marathoners, he avoids 150-mile weeks. His all-time high was 136 miles at altitude ahead of the Athens Olympics in 2004. Four weeks before a major marathon, he heads to Mammoth Lakes, Calif., for altitude training. There, he sleeps at 9,000 feet and drives 80 miles round-trip each day to run at 4,000 feet.

Such altitude training helps to boost the production of red blood cells, which then increases the supply of oxygen during a race.

Ideally, he wants his 5-foot-5-½-inch frame to weigh in at 122 pounds by race day. A typical day features a long “tempo” run at near-race pace. The next day he might do a shorter interval workout such as high-speed one-mile “repeats.” On day three, he might do an easier recovery run, such as an hour-long 10-mile jaunt. Each cycle includes one long run of at least 20 miles. To avoid overtaxing his joints, he runs on grass or hard dirt whenever possible.

Some afternoons, he slips in a 90-120-minute ride on his elliptical bike, which mimics the running motion minus the pounding.

Breakfast, around 6:30 a.m. is two pieces of whole grain toast or hambasha, an Eritrean bread, with almond butter and maybe some eggs. He walks his two older daughters to school. He has more protein and carbs at lunch and fruits throughout the day, such as mangoes, peaches and blueberries. He drinks a protein shake after each run. Dinner consists of whole-grain pasta with chicken or meat. He says he rarely drinks alcohol, beyond the occasional half glass of wine.

At Home With Meb Keflezighi A behind-the-scenes look at marathoner Meb Keflezighi in San Diego, where he lives and trains. Meb Keflezighi runs with his kids and his wife, Yordanos, to school from their home in San Diego. Sandy Huffaker for The Wall Street Journal 1 of 7 • • • • • 1 of 7 Show Caption Meb Keflezighi runs with his kids and his wife, Yordanos, to school from their home in San Diego. Sandy Huffaker for The Wall Street Journal

On a recent day, Keflezighi did a one-mile warm-up run (at a 7-minute per mile pace) across the grass of Mission Bay Park. Then he changed into his racing shoes for a series of one-mile repeats around the park’s Fiesta Island, a barren, man-made peninsula.

Running next to his training partner, Richard Levy, who rides his bike in front of him on nearly every run, Keflezighi ripped off eight mile repeats—the fastest at 4:32, the slowest at 4:49. Between each he rested for 2½ minutes.

A three-mile cool down, at a 7-minute-mile pace, followed. Then came about 15 minutes of high-knee sprints, sideways-walking squats and various awkward forms of strength training.

Afterward, he iced a sore knee and ankle. He took a digestive aid—commonly used among elite runners—to speed his metabolism and help him lose the 7 pounds he wants to drop before New York. He also took several supplements supposed to keep his joints, bones and immune system healthy.

Midday brought a massage. In late afternoon he rode for 90 minutes on the elliptical bike. At night he encased his legs in plastic boots that use pulsating air pressure to compress his limbs and improve circulation. He skipped a session hanging upside down on the rotating table.

The next morning was an easier one, designed to help Keflezighi recover from the previous days’ speed work. As he set out in Mission Bay Park, Keflezighi planned to do eight miles at a 6:15 pace, but he ended up tacking on another two. That was going to be it for the day, but by late afternoon his legs were back to life—enough to do 90 minutes on the elliptical bike.

Recovery plans often give way to more work. “Always your mind is thinking about what else you can do,” says Keflezighi.

His practice approach is almost completely insular, in contrast to runners who work with a larger group. Many of Kenya’s elite marathoners train together in Africa’s Rift Valley.

On race day, that insularity can have advantages.

The day before April’s Boston Marathon, Keflezighi ran into Desisa, the defending champion, in a hotel elevator. He wished Desisa luck. Keflezighi says Desisa barked that the race was going to be a war and that he planned to destroy the field.

As for Chebet, a three-time winner of the flat and fast Amsterdam Marathon, he says that Keflezighi never entered the minds of the African runners before the race. They focused only on one another.

On the way to the starting line, Keflezighi noted the calm, sunny morning. No headwind. He could take a lead if he wanted without having to battle the elements.

He couldn’t be greedy, though. Even if the opportunity to grab a lead arose, he had to maintain an even pace on the notoriously hilly course.

Keflezighi has never run a flat marathon in cool weather while in peak shape. That fact allows him to think that in ideal conditions he might be fast enough to match the fastest Africans. He would like to believe he could run a 2:05 or 2:06 marathon, but he never has.

Marhawi Keflezighi, his brother and manager, says for Meb to win, he has to set a pace so that the race finishes between 2:07 and 2:10. If the pace is faster, he might not be able to keep up. If it is slower, he might lack the speed to outkick a rested field at the end.

Keflezighi was quick off the starting line and sprinted to the front. During the first few miles, he noticed the Africans didn’t want a fast race. They kept going to the front as a group, trying to block anyone who tried to surge.

The pace was relatively slow—a 4:59 opening mile. The first five-kilometer (3.1-mile) split was a little more than 15 minutes. Keflezighi noticed that Desisa’s mechanics were off. He seemed to have no rhythm.

Since his teens, Keflezighi’s forte has been to push the pace. He doesn’t let competitors relax, so they can force the race to come down to the final 200 meters, a tactic known as “sit and kick.” After five miles, Keflezighi made his first surge—just to see the African reaction.

There was none. “I made a move and they let me go,” he says.

Only Josphat Boit, a Kenyan-born naturalized American citizen, went with him. At the eight-mile mark, Keflezighi told Boit he had no idea what the Africans were doing. The two drafted off each other for the next two miles, trading the lead. Then Boit, better known for shorter 5,000 and 10,000-meter races, opened up a lead of nearly 50 meters from miles 10-12.

Keflezighi stayed calm. Then he glanced over his shoulder and saw a large group not far behind. He sprinted to catch up with Boit. They passed the halfway mark in 1:04:21. The race was right in Keflezighi’s sweet spot.

At 14 miles, Boit, a Boston Marathon rookie, accidentally clipped Keflezighi’s foot, a common error when a runner tires. Keflezighi decided to make a break. He ran mile 16 in 4:39 and began the brutal Newton hills alone.

As he climbed, a familiar pain arose. In 2007, Keflezighi had a bothersome callus removed from the bottom of his left foot. Every marathon since, the area has blistered, making each step in the final third of the race feel like a nail pounding through his skin.

Meb Keflezighi describes the breakaway move that led to his 2014 Boston Marathon victory. Photo: Associated Press

He saw the American flags, heard the “USA” chants and told himself to ignore the pain. “I said, ‘This is for my country. This is for the victims.’ ” The cheers carried him through the hills and across the 21-mile mark, where Heartbreak Hill descends.

Just then, a disturbing realization hit Chebet and the rest of the Africans. Keflezighi, whom they’d assumed would fade, was out of sight. “I realized we have a real problem,” Chebet recalls.

Chebet sped up, narrowing the gap with each mile, until only six seconds separated him from Keflezighi, with a little more than a mile to go.

“Maintain the gap,” Keflezighi told himself as he passed Fenway Park. Before the slight uphill with one kilometer to go, he thought of two words—“quick feet.”

Ahead were two quick turns, a right onto Hereford Street and a left onto Boylston. Seeing a chance to put the race away, Keflezighi sprinted down Hereford onto Boylston, running so fast that he pulled up with the police motorcycles. As he turned onto Boylston, Keflezighi disappeared around the corner.

“The idea was to use the fact that he can’t see me to break him, so he comes around that turn and he says, ‘Where did he go?’” Keflezighi recalls.

Keflezighi broke the final tape in 2:08:37, his fastest-ever marathon. Desisa says only at that moment did he accept that Keflezighi could win Boston.

In New York, the Africans will likely know better than to let him build up a lead. They will include former world-record holder Wilson Kipsang and defending champion Geoffrey Mutai.

It is a different race than in Boston. In New York, runners often make a fatal error at mile 16 as they enter Manhattan. There, the excitement of the crowd pushes them to run too fast up First Avenue. In Boston, the Newton hills at mile 16 force runners not to go too fast too early.

To win New York, Keflezighi will probably need to run another personal-best marathon, and hope that his opponents either run conservatively again or go out too fast and hit the wall. “I’m going to do whatever I can to get rid of you. So you better try to get rid of me before that.”