A year ago, while making her Boston Marathon debut, Sharon Cherop found herself in a three-person lead pack near the end, but couldn’t generate the necessary closing push that victory in this race almost always requires. She finished third.

Cherop made sure history didn’t repeat itself one year later. Breaking free from a step-for-step duel with countrywoman Jemima Jelagat Sumgong as the pair made the race’s final turn onto Boylston Street, Cherop overcame intense heat, a minor knee injury, and every challenge from her elite peers, winning the Marathon Monday by two seconds in another tight finish. Each of the past five winning margins in the women’s race has been three seconds or fewer.

The 28-year-old Cherop didn’t set a personal best or threaten the course record with temperatures in the mid-80s, but she led a Kenyan sweep of the top three spots, breaking the tape in 2 hours 31 minutes 50 seconds. Sumgong (2:31:52) was second, with Georgina Rono (2:33:09) third.

Course familiarity - and a keen sense of who she was up against - helped Cherop.

“This time I knew the course. I had already decided. I was going to start my sprint at the corner,’’ said Cherop, who earned her third marathon victory, following 2010 titles in Toronto and Hamburg. “We work together, so I knew how [Sumgong] runs.’’

Cherop and Sumgong pulled away from what had been a five-runner lead pack by Mile 23, creating separation and making it a test between friends. A test of endurance, test of strategy, test of mental and physical limits. Cherop made the decision to go first, only looking back to see if Sumgong could follow. She could not.

“I was with my friend Sharon until maybe 300 meters to go, then she broke free,’’ Sumgong said. “It was a comfortable pace, but she was pushing hard at the end and I couldn’t do it.’’

As soon as the pair hit Boylston Street and turned toward the finish line, Cherop began pulling away: 10 feet, then 20, up to 30. Sumgong made a late charge to close the gap, but ran out of room and finished roughly 15 feet behind.

The victory was worth $150,000, and improved Cherop’s chances at making Kenya’s three-woman marathon team for this summer’s London Olympics, despite saying after the race she’s not sure where she stands. Of the six women up for consideration, Cherop was the only one to run Boston.

An announcement won’t come until the end of April, but one of Kenya’s decision-makers, in Boston to watch the race, appeared to stamp Cherop’s Olympic ticket.

“That’s good enough for her,’’ Isaiah Kiplagat, chairman of Athletics Kenya, when asked if winning Boston puts Cherop on the team.

Cherop wasn’t sure she’d even be healthy enough to run Boston until a few days before the race. A minor injury to her right knee left her less than 100 percent, so the heat - which would mean a slower pace - would provide at least one benefit for the eventual champion.

“I was measuring my progress day by day. It kept improving, but I was not 100 percent,’’ Cherop said. “That is why the slow race was good. It helped me see how my knee was feeling.’’

It felt good enough that she was never out of the lead pack, which swelled to eight by the halfway point, but had dwindled to five as the group passed Route 128: Cherop, Sumgong, Rono, Firehiwot Dado of Ethiopia, and Kenya’s Caroline Kilel, who was trying to become the first woman to win back-to-back Bostons since Catherine Ndereba in 2004-05.

Nearly two hours into the race, Kilel collided with a spectator handing out water at one of the numerous liquid stations. Kilel remained on her feet, but was thrown off-stride, dropped to fifth, then briefly retook the lead. She fell back again as the pack neared Boston College - followed by Dado - and dropped out of the race soon after.

That left Cherop, Sumgong, and Rono, three Kenyans left to battle for one of racing’s most prestigious winner’s wreaths. Three miles from the finish, Cherop and Sumgong broke from Rono, setting up their shoulder-to-shoulder dash.

“I was trying to catch my friend,’’ said Sumgong, twice a marathon winner (2006 Las Vegas, 2011 Castellon) who has never finished outside the top five. “I didn’t, but I am still very happy.’’

Dado (2:34:56) was fourth, followed by two more Kenyans - Diana Sigei (2:35:40) and Rita Jeptoo (2:35:53).

Sheri Piers, a 40-year-old mother of five from Falmouth, Maine, was the top US finisher, placing 10th in 2:41:55. It’s only the fifth year in the past 15 that an American has cracked the top 10 in the women’s race.

“It went better than I expected,’’ Piers said.

Cherop might say the same, but she returned to Boston with the goal of being better prepared, using what she learned last year - “I realized there’s more downhill than uphill’’ - and applying it. That meant training on downhills more, it meant pacing herself better regardless of the heat, and it meant knowing the exact moment to hit the gas.

Making the turn onto Boylston, she accelerated one final, fateful time.

“It depended on the person I was going to be with. If it was a Kenyan I needed to speed up at 600 [meters] and again at 300 meters,’’ Cherop said. “If it was an Ethiopian, you have to be careful because they’re known for having a stronger finishing kick than Kenyans.

“This time around I was really prepared. I stuck to a plan. I’m so happy.’’