DETROIT — The Red Sox were two outs away from another dispiriting loss. Another night with too many runners left stranded in scoring in position, another wasted quality start.
Then, with one swing of the bat, David Ortiz fixed it all.
His three-run home run in the ninth inning gave the Red Sox a much-needed 5-3 victory against the Detroit Tigers on Sunday night.
The shot deep into the seats in right field against fill-in closer Joba Chamberlain snapped a five-game losing streak. It was only the second time this season the Sox won a game when they trailed after eight innings.
“We needed a win. There was no doubt about it,” manager John Farrell said.
Ortiz had failed to drive in the go-ahead run in the seventh inning, lining to center field with two runners on. In the fifth inning, in one of the rare times a team didn’t shift against him, Ortiz lined out to third base with a runner on second and two outs.
“I think I broke my own record of hitting hard balls right at people,” Ortiz said.
Ortiz said Farrell called a “little meeting” before the game and told the players to keep on fighting and the effort had been there.
“We don’t give in,” Ortiz said.
Closer Joe Nathan threw 32 pitches on Saturday, so the Tigers sent out Chamberlain for the ninth. Brock Holt singled and Dustin Pedroia drew a walk with one out. Ortiz then sent a 1-and-1 slider from Chamberlain into the seats for his 14th home run.
“I’ve faced Joba all the time and he’s got good stuff. I saw him throwing too many sliders tonight. That’s his weapon. Obviously he hung one in the strike zone and I hit it well,” Ortiz said.
It was the 16th time Ortiz has decided a game with a home run in the ninth inning or later in his career.
“He’s special. He’s a guy who obviously loves those situations,” said John Lackey, who was suddenly in line for the win. “He’s done it so many times. It’s funny. You almost expect it. He’s the real deal in those spots.”
It was the first home run for Ortiz since May 26 and the 445th of his career. His 19 home runs at Comerica are the most for an opposing player.
Mike Napoli came off the disabled list to go 3 for 4 with a home run and a walk for the Red Sox. Holt was 4 for 5. But the Sox were 1 for 11 with runners in scoring position before Ortiz’s home run.
It was the first win in six games against the Tigers for the Sox this season.
Lackey (7-4) went eight innings for the win, allowing two earned runs on seven hits with one walk and five strikeouts.
“Eight solid innings, keeps that lineup to a couple of runs and gave us a chance. Hell of a job by him,” Napoli said.
Koji Uehara pitched the ninth inning for his 12th save. He has not allowed a run in 16 consecutive innings and converted his last 28 save chances.
Lackey thought it was no coincidence Napoli was standing on deck when Ortiz connected. In his first game back after 15 days on the disabled list.
“You kidding me? They wouldn’t have thrown one near the strike zone if that dude wasn’t standing on deck,” Lackey said.
Detroit starter Anibal Sanchez went six innings, allowing two runs on six hits. He walked two and struck out seven.
The Sox scored a run in the third inning and wasted a chance for more, a regular theme.
Jackie Bradley Jr. singled with one out before Holt, the new left fielder, singled and Xander Bogaerts drew a walk to load the bases. Pedroia’s sacrifice fly gave the Sox a 1-0 lead. Ortiz then struck out to end the inning.
Napoli, who was on the disabled list to give his badly swollen left ring finger a break, led off the sixth inning with a home run the other way to right field.
Sanchez had gone 55⅓ innings this season without giving up a home run. The last hitter to connect against him had been Napoli in Game 5 of the American League Championship Series at Comerica Park last season.
A.J. Pierzynski was next and he reached on an error by third baseman Nick Castellanos. With one, Stephen Drew grounded to shortstop. Pierzynski took second on the play but wandered off the bag and was thrown out.
Farrell, obviously annoyed, said Pierzynski overran the bag.
Lefthander Ian Krol started the seventh inning for Detroit and allowed a one-out triple by Holt.
The Tigers called in righthander Evan Reed and pulled the infield in for Bogaerts. He hit a hard grounder to the left side, but Castellanos made a diving play to save a run.
After Pedroia walked, the Tigers went to lefthander Phil Coke to face Ortiz.
Ortiz swung at a 3-and-0 fastball and fouled it off. On the seventh pitch of the at-bat, he lined to center field. Counting the postseason, Ortiz is 2 for 21 against Coke.
Lackey, who has a 3.18 ERA, was tough again. Detroit scored a run in the third and another in the fourth when Miguel Cabrera doubled to right field and Victor Martinez singled to right.
Cabrera left the game in the sixth inning with a tight left hamstring. He was 6 of 10 in the series with three doubles.
In a 2-2 game, Lackey was let down by his defense in the seventh inning.
Castellanos led off with a single. Austin Jackson then grounded to Bogaerts and the ball popped out of his glove for his first error of the season at third base.
Lackey struck out Alex Avila for the third time, but Eugenio Suarez singled to left field for his second RBI.Peter Abraham can be reached at email@example.com. Follow him on Twitter @peteabe.