The simple thought crossed Shalane Flanagan’s mind as she raced alone through Central Park: Just keep it together, keep it together.

She would not dare look over her shoulder. Her gaze remained ahead, on the prize that had eluded an American female marathon runner like herself since 1977.

Flanagan, 36, had a vague sense of the history. She felt a more personal stake in this New York City Marathon taking place just days after a terror attack in Lower Manhattan. It reminded her of the inspiring performance by her friend Meb Keflezighi, the American male winner of the first Boston Marathon after the bombing in 2013 (he was in this race, too, in what he said would be his last marathon).

That is partly why, as the finish line neared, Flanagan, with tears in her eyes, began pointing and shouting (with maybe a few colorful words thrown in).