NEW YORK — Joyciline Jepkosgei arrived in New York with a modest goal for her first marathon ever.
‘‘My focus was to finish the race,’’ she said, a gold medal hanging around her neck.
Not bad for a novice.
Jepkosgei upset four-time champion Mary Keitany to win the New York City Marathon on Sunday with a historic debut seven seconds off the course record.
Geoffrey Kamworor of Kenya won the men’s event for the second time in three years. He pounced when defending champion Lelisa Desisa dropped out after 7 miles, perhaps hurting following a grueling victory at the sweltering world championships last month.
After pulling away from Kenyan countrymate Keitany with about 3 miles left, Jepkosgei crossed the finish in Central Park in 2 hours, 22 minutes 38 seconds, the second-best run in course history.
‘‘I didn’t really know I could win,’’ she said. ‘‘But I was trying my best to do it and to make it and to finish strong.’’
The 25-year-old Jepkosgei holds the world record in the half-marathon but had never run this distance. She looked pained climbing the final hill but strode confidently over the final line.
It was too much for Keitany, a 37-year-old who collapsed after finishing 53 seconds later. She had won four of the previous five NYC Marathons.
Jepkosgei is the youngest New York winner since 25-year-old Margaret Okayo in 2001. She also won the New York City Half-Marathon in March and is the first runner to win both events.
Kamworor made it a Kenyan sweep moments later with a final time of 2:08:13.
He kicked away from countryman Albert Korir in the 24th mile. Korir finished second, and Ethiopian non-elite runner Girma Bekele Gebre was third.
Desisa, who is from Ethiopia, was in 17th place at the 7-mile mark before leaving the course that traverses through the city’s five boroughs. He was attempting to defend his title 29 days after winning worlds in Doha, Qatar, in boiling conditions he described this week as ‘‘dangerous.’’ With a temperature of 84 degrees for the midnight start, 18 of 73 men didn’t finish that race.
Sunday’s run started at an ideal 45 degrees.
The 26-year-old Kamworor finished third last year after winning in 2017. He was greeted at the finish line by mentor and training partner Eliud Kipchoge, who completed the first sub-2 hour marathon last month — a feat accomplished under conditions so tightly controlled it didn’t qualify for the record books.
‘‘I didn’t want to disappoint him,’’ Kamworor said. ‘‘That gave me a lot of motivation. He inspired me to win that race.’’
Kamworor, also the world record holder in the half-marathon, is the 10th multi-time winner in New York.
#tfw your mentor is the fastest marathoner in history...— TCS New York City Marathon (@nycmarathon) November 3, 2019
Congratulations again to @GKamworor, your 2019 #TCSNYCMarathon men’s open division champion!
Joining him at the awards ceremony is the one and only @EliudKipchoge pic.twitter.com/eNiTfE8q2f
He was followed closely by Gebre, a former New York resident who returned to Ethiopia recently to train at altitude. He shaved about five minutes off his personal best to finish in 2:08:38.
The 26-year-old Gebre has no sponsor and no agent. He’s hoping this breakthrough race will change that.
‘‘I would like someone to arrange some races for me,’’ he said through a translator.
American Desiree Linden set the pace for the women early and was the top US finisher at sixth. The 2018 Boston Marathon winner hasn’t decided whether she will go to the Olympic team trials in Atlanta on Feb. 29.
The 36-year-old wants to gauge her recovery before deciding whether to pursue a third Olympics.
‘‘Right now’s not the time, just based on how my calves and my feet feel,’’ Linden said jokingly.
Kellyn Taylor, an American putting her firefighting career on hold to pursue the Olympics, finished seventh.
Sara Hall, another US Olympic hopeful who has taken on an unusually heavy race schedule, dropped out in mile 18 after running the Berlin Marathon on Sept. 29.
Jared Ward was the top American finisher among the men at sixth place.