NEW YORK -- Joyciline Jepkosgei arrived in New York with a modest goal for her first marathon.

"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 line in Central Park in 2 hours, 22 minutes and 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."

Jepkosgei, 25, 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, 37, 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 Margaret Okayo, who was 25, 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.

Kamworor, 26, 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.

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.

Gebre, 26, 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, 36, set the pace for the women early and was the top U.S. 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. She 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 U.S. 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. He hoped the hilly New York terrain would prepare him for the rolling course in Atlanta.

"I hope that does set me up well," he said. "I think I have some confidence."

American 42-year-old Abdi Abdirahman bested his own over-40 record by finishing in 2:11:34. Australia's Sinead Diver posted the second-fasted women's time by an over-40 runner. The 42-year-old finished fifth overall in 2:26:23.

Manuela Schar of Switzerland won her third straight women's wheelchair title, giving her eight consecutive marathon major victories. After rolling ahead of the record pace for much of the race, Schar crossed the finish about a minute off the mark at 1:44:20.

Daniel Romanchuk of the United States repeated as men's wheelchair champion in another tight finish over Switzerland's Marcel Hug. Romanchuk held off Hug by one second for the second straight year, crossing the finish line 1:37:24 England's David Weir and American Aaron Pike were also within 10 seconds.

Last year, Romanchuk became the first American and youngest competitor to win the men's division as a 20-year-old. He followed with victories this year at the Boston and London marathons. Hug took the New York title in 2016 and 2017.

Organizers were expecting around 52,000 runners to complete the marathon a year after a world-record 52,813 crossed the finish line.