Keitany’s unexpected break from the lead pack threw the women’s race into early upheaval, as her competitors stretched out one by one along the course to jockey for the remaining two podium spots. The 2012 Olympic silver medalist, Sally Kipyego of Kenya, placed second in 2:28:01, and Molly Huddle of the United States, in her marathon debut, was third in 2:28:13.

Keitany is the first woman to win three in a row since Grete Waitz won five from 1982 to 1986.

As her pink sneakers bounced steadily off the pavement through the five boroughs, Keitany, 34, showed that she has no problem running alone — provided she has a chance to start at all. Though she is the second-fastest woman in history and her country’s record holder (2:18:37), Kenya left her off its Olympic team this year after she collided with Jemima Sumgong and fell in the London Marathon with about five miles to go and subsequently failed to win.

The snub left her to focus on her fall race. She chose to execute a bold maneuver against a weak field.

Ghebreslassie, who won the world championship in Beijing in 2015 at age 19, finished in fourth place at the Rio Olympics this year. He is the first Eritrean citizen to win the New York City Marathon; the Eritrean-born Meb Keflezighi has also won, but as an American citizen.