OAKLAND, Calif. -- David Ortiz hit a leadoff home run in the 10th inning and the Boston Red Sox beat the Oakland Athletics 7-6 on Sunday to avoid a four-game series sweep.
Ortiz was the only Boston starter without a hit until he lined a 1-2 pitch from Fernando Abad (2-3) over the wall in left-center.
The Red Sox had to go extra innings after letting a 6-1 lead slip away. The A's scored three runs in the eighth, and then homered twice in the ninth against Koji Uehara (3-1). The closer had converted 31 consecutive save opportunities dating to 2013.
Mike Napoli and David Ross also homered for Boston, which had been limited to two runs or fewer in eight consecutive games. Napoli scored another run as part of a double steal, and former A's player Jonny Gomes added a two-run single.
Oakland's late surge negated a strong outing by Boston starter Jon Lester.
Lester, who had a career-high 15 strikeouts against the A's earlier this season, allowed two earned runs and four hits over 7 2/3 innings. He struck out four and walked two.
The veteran left-hander left after hitting Craig Gentry and walking Jed Lowrie with two outs in the eighth.
Burke Badenhop came in and gave up three consecutive RBI singles to make it 6-4 before Andrew Miller got pinch-hitter Coco Crisp to line out to shortstop.
Uehara, who had the longest successful save streak in the majors, blew a shot at extending his impressive run when he yielded home runs by Stephen Vogt and pinch-hitter John Jaso.
The A's had won five straight before Ortiz's 17th homer bailed out Boston's bullpen.
Oakland catcher Derek Norris had to leave the game in the 10th after a frightening situation when he was hit in the back of the head by Gomes' bat on a follow-through swing. Norris immediately dropped to the ground as home plate Greg Gibson quickly called for A's trainers.
Norris was eventually helped to his feet and walked to the dugout.
Boston broke out of its week-long scoring slump and got to Tommy Milone after loading the bases with two outs in the first on two singles and a walk. Gomes' two-run single put the Red Sox up 2-0.
Ross, who homered off Milone earlier this season at Fenway Park, did it again on the first pitch in the second.
Oakland cut the gap to 3-1 when Norris reached on an error and scored on Alberto Callaspo's double off the left-field wall.
Lester got some help from his defense to limit the damage in the inning. Shortstop Jonathan Herrera threw out Kyle Blanks trying to score from third on a fielder's choice.
Napoli and Herrera pulled off a double steal in the third to put Boston up 4-1. With Herrera caught in a rundown between first and second, Napoli broke from third and beat the wide throw home from Nick Punto while sliding past the tag of Norris.
Milone allowed five runs and eight hits over five innings. He struck out three and walked one while losing for the first time in nine starts dating to April 27.