2017 New York City Marathon

Olympic runner Shalane Flanagan edged out Kenyan rival Mary Keitany on Sunday to become the first American woman to win the New York City Marathon since 1977. Geoffrey Kamworor of Kenya has won the New York City Marathon, holding off countryman Wilson Kipsang by three seconds for his first major victory.

Runners from across the country and around the world competed in the New York City Marathon on Sunday, just five days after a truck ramming attack killed eight people and wounded others in lower Manhattan.

More than 51,000 people participated in this year’s marathon, while another 2.5 million spectators lined the streets of New York City as the world-famous race took runners through all five boroughs.

The marathon is taking place several miles north of the scene of a deadly attack on Oct. 31, in which a man driving a Home Depot truck plowed into pedestrians and cyclists on a busy bike path near West Houston Street and the West Side Highway. (AP)

See more news-related photo galleries and follow us on Yahoo News Photo Twitter and Tumblr.

2017 New York City Marathon

Shalane Flanagan of the United States poses for pictures after crossing the finish line first in the women’s division of the New York City Marathon in New York, Nov. 5, 2017. (Photo: Seth Wenig/AP)

2017 New York City Marathon

Geoffrey Kamworor of Kenya crosses the finish line first in the men’s division of the New York City Marathon in New York, Nov. 5, 2017. (Photo: Seth Wenig/AP)

2017 New York City Marathon

Marcel Hug of Switzerland crosses the finish line first in the men’s wheelchair division of the New York City Marathon in New York, Sunday, Nov. 5, 2017. (Photo: Seth Wenig/AP)

2017 New York City Marathon

Shalane Flanagan of the United States crosses the finish line first in the women’s division of the New York City Marathon in New York, Nov. 5, 2017. (Photo: Seth Wenig/AP)

2017 New York City Marathon

Manuela Schar of Switzerland crosses the finish line first in the women’s wheelchair division of the New York City Marathon in New York, Sunday, Nov. 5, 2017. (Photo: Seth Wenig/AP)

2017 New York City Marathon

The lead group of the elite men’s race crosses the Willis Avenue Bridge during the New York City Marathon, Nov. 5, 2017, in New York. (Photo: Jason DeCrow/AP)

2017 New York City Marathon

A pack of runners reach First Ave. just past mile 16 of the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

Runners cross the Verrazano-Narrows Bridge during the New York City Marathon, Nov. 5, 2017, in New York. (Photo: Craig Ruttle/AP)

2017 New York City Marathon

A police presence is seen as runner gives cross into Manhattan during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A spectator waves an Argentinan flag along the route past the 59th Street Bridge during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

People hold up a placard to support a friend running in the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A runner douses himself with water during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

Volunteers hold out cups of water for runners during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A pack of runners reach First Ave. just past mile 16 of the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A runner cools himself on with water during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

In a long exposure, runners step on used water cups discarded on the street during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

Two members of the NYPD running club break for water and a photo during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A pack of runners reach First Ave. just past mile 16 of the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

People hold up a placard to support a friend running in the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A runner looks like he is feeling the pain during during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A runner douses himself with water during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A participant dumps her cup of water during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

People hold up a placard to support a friend running in the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A pack of runners reach First Ave. just past mile 16 of the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A runner sports a interesting hairstyle during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A spectators attempts to pump up the runners in First Avenue during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

People hold up a placard to support a friend running in the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A runner wears a tutu during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A runner gives a thumbs up during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

Runners step on used water cups discarded on the street during the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

2017 New York City Marathon

A runner wearing the stars and stripes participates in the 2017 New York City Marathon, Nov. 5, 2017. (Photo: Gordon Donovan/Yahoo News)

By using Yahoo you agree that Yahoo and partners may use Cookies for personalisation and other purposes