Shalane Flanagan became the first American woman in 40 years to win the New York City Marathon, which went ahead on Sunday just five days after a deadly Manhattan truck attack that left eight people dead.

Flanagan, who not did run this year's Boston Marathon due to a back injury, captured her first major world marathon crown in an unofficial time of 2hrs 26mins 53secs.

Kenya's Mary Keitany, who was chasing her fourth consecutive New York victory, settled for second, 61 seconds back, with Ethiopia's Mamitu Daska third in 2:28:08.

At age 36, Flanagan became the first US woman to win on the streets of the Big Apple since Miki Gorman in 1977.

Flanagan, the 2010 New York marathon runner-up, was sixth in last year's Rio Olympic marathon. She was the 10,000m runner-up at the 2008 Beijing Olympics.

After a slow pace in the first half of the race, Keitany took the lead just after the midpoint and surged at 15 miles, shrinking the front pack to nine before slowing the pace once again.

At 21 miles, Keitany, Flanagan and Daska pulled away and at mile 23, Flanagan grabbed the lead for good.

Expanded security lined the route of the world-famous race, which saw an estimated 50,000 runners from more than 125 nations compete over 26.2 miles (42.1km) across the city streets.