An emotional and exuberant Shalane Flanagan came to the finish line of the New York City Marathon and enveloped herself in an American flag, the magnitude of what she had accomplished bringing her to tears and to her knees.

Flanagan became the first American woman since Miki Gorman won the second of her back-to-back NYC marathons in 1977 to win the race, finishing in an unofficial time of 2:26:53. Flanagan, 36, is the American record holder in the indoor 3,000 meters, the indoor 5,000 and won a bronze medal that was upgraded to silver in the 10,000 in the 2008 Olympics. She finished sixth in the Rio Olympics marathon.

Flanagan previously finished second in the 2010 NYC Marathon, her first marathon, but had not run it since then. A fracture kept the Massachusetts native out of the Boston Marathon, so Flanagan put Mary Keitany, who was trying to become the second runner (besides Grete Waitz) to win the NYC race four times in a row, atop her goals, training with an eye on the woman she had called “the alpha racer.” Keitany finished in an unofficial 2:27:54 and Mamitu Daska was third in 2:28:08.

“Sometimes we don’t realize the moment when we feel like dreams are taken away that actually there’s some delayed gratification down the road,” Flanagan said after the race (via Runner’s World). “I think it was a blessing that I got injured this past winter and I came here full of energy and motivation and desire to put on the best performance of my life.”

On the men’s side, Geoffrey Kamworor was the winner in an unofficial time of 2:10:53, three seconds faster than Wilson Kipsang. Lelisa Desisa, a two-time Boston Marathon champion, was third in 2:11:32. The race marked the 26th and final marathon as a professional for Meb Keflezighi. Now 42, the man whose bib says simply “Meb,” won the NYC marathon in 2009 and the Boston Marathon in 2014 and finished 11th Sunday in 2:15:29.

Among celebrities in the race, Kevin Hart had the best request. “If I come through here with a weird face, don’t meme me to death, all right? I don’t want to see a bunch of memes of me looking bad out here. Just know I’m giving it my all.”

Security for the 26.2-mile race through New York’s boroughs was especially tight this year, coming just days after a terrorist attack on a lower Manhattan, the deadliest in the city since the Sept. 11, 2001 World Trade Center attacks.