BOSTON -- The Baltimore Orioles, fighting to stay alive in the American League wild card chase, pulled out a special victory on Tuesday night at Fenway Park.
Chris Davis tied the score with his club-record 51st home run in the sixth inning and the Orioles, who entered play two games off the wild card pace, struck for a run against dominant closer Koji Uehara to pull out the 3-2 win.
Uehara (4-1) had retired 37 straight batters when he entered to start the ninth inning and was greeted by a long triple from Danny Valencia. Matt Wieters' sacrifice fly gave the Birds the lead and Jim Johnson pitched the bottom of the inning for his 46th save.
The comeback allowed the Orioles, a team ready to shatter the major league record for fewest errors in a season, to win on a night they made a season-high three errors and with starter Scott Feldman walking a career-high six batters in five innings.
Reliever Tommy Hunter (6-4) got two outs and was credited with the victory.
Ryan Dempster started for Boston and went the first six innings, failing to hold a 2-0 lead.
Davis broke Brady Anderson's 1996 club record with his home run in the sixth.
Dustin Pedroia led off the game with a home run, his first since July 31, but the Red Sox got only two hits the rest of the night, one a one-out single against Johnson in the ninth.
The loss kept the Red Sox, whose magic number for clinching the AL dropped to three with Tampa Bay losing, from securing up a playoff spot. They needed a win and a Cleveland loss to clinch their first playoff berth since 2009.
Craig Breslow relieved with second and third and nobody out in the eighth and retired Davis, Adam Jones and Nick Markakis -- the middle of the Baltimore lineup -- without a run scoring. But it wasn't enough to keep Boston from losing for the second time in eight games.
Pedroia's towering homer was his first leadoff shot since 2009, the third by a Boston player this season (Jacoby Ellsbury has the other two) and the 99th of his career. It also snapped a string of 176 at-bats without a homer for Pedroia.
The next time up, with the bases loaded and two outs in the second, Pedroia hit a hard line drive that was speared by second baseman Brian Roberts.
The Orioles became unglued in the fourth. An error by third baseman Manny Machado led to a double steal by Jarrod Saltalamacchia and Stephen Drew and then an error by left fielder Nate McLouth. Boston scored once and could have had more, but Pedroia banged into a double play.
The Orioles got a run back in the fifth on a walk, a J.J. Hardy double and a groundout.
NOTES: The three steals in the first four innings gave the Red Sox 35 straight, a club record. ... The center-field flag at Fenway Park was at half-staff because of the tragedy in Washington. ... Boston recalled RHPs Steven Wright and Brayan Villarreal and IF Brock Holt from Pawtucket. ... Sox 3B Will Middlebrooks was over his flu-like symptoms but missed his second straight game. ... The Orioles, who reinstated OF Steve Pearce from the 15-day disabled list and OF Henry Urritia from the restricted list (the Cuban defector wasn't allowed to travel to Canada because of immigration trouble), hope to have Bud Norris, out with an elbow problem, start Saturday against Tampa Bay. With Miguel Gonzalez already hurt, manager Buck Showalter said he didn't know what he'd do if Norris, who threw in the bullpen on Tuesday with no reported problems, can't go. "We used to call it Johnny Wholestaff," Showalter said. "We'll see. I'm hoping Bud feels good enough to (start)." ... Orioles RHP Darren O'Day, out since Sept. 7 with tingling and numbness in his fingers, could rejoin the bullpen on Wednesday night.