BOSTON — Kenyan Rita Jeptoo won her second straight Boston Marathon and third overall in course-record time.

Jeptoo completed the 26.2-mile course in a 2 hours, 18 minutes, 57 seconds. She shattered the course record of 2:20.43. Second place Buzunesh Deba of Ethiopia also beat the previous course record, clocking 2:19:59.

“I was not expecting to run fast like that,” Jeptoo said. “Starting this race, my body did not respond well.”

Jeptoo took over after Massachusetts native Shalane Flanagan led early in a bid to become the first U.S. woman to win the race since 1985. Flanagan finished seventh, unofficially in a personal best of 2:22:01 and the fastest time ever by a U.S. woman at the Boston Marathon.

“I love Boston so much,” said an emotional Flanagan in a TV interview. “I really wanted to do it for my city.”

Flanagan was spurred on by what was expected to be a record crowd along the course, one year after she finished fourth in her Boston Marathon debut.

“My ears were screaming,” said an emotional Flanagan in a TV interview. “I couldn’t even hear myself think. It was insane. It’s the most enjoyable race I’ve run in my life. I tried to treasure every step of it because these opportunities only come once in a lifetime.

“I’ve never seen Boston so special.”

Jeptoo, 33, became the first woman since 2005 to repeat as Boston Marathon champion. She grabbed the lead alone after 20 miles and buried the field with a blistering last few miles, much like she did last year. Jeptoo won $150,000 for the victory and another $25,000 for the course record.

Jeptoo went seven years between major marathon victories from 2006 to 2013 but claimed not only Boston but also Chicago (in a personal best time) last year. She was the fastest women’s marathoner in 2013.

Flanagan, the 2008 Olympic 10,000m bronze medalist, will run in Boston again.