BOSTON -- Jim Thome returned after missing nearly two months with a herniated disc and hit an RBI double in the 12th to drive in the go-ahead run and Baltimore held on for a 9-6 win over the Boston Red Sox on Saturday, extending the Orioles' season-long winning streak to six.
Endy Chavez and Manny Machado followed Thome with RBI singles to give the Orioles a bit of a cushion for closer Jim Johnson, who allowed a hit but no runs while recording for his major league best 47th save.
The Orioles won their 16th straight extra-inning game, but this one only went that far because the Red Sox rallied from a 6-3 deficit with two runs in the seventh and another in the eighth.
Baltimore's bullpen settled down after that and kept it tied until Adam Jones, whose leadoff homer in the seventh put Baltimore up 6-3, led off the 12th with a double to center off of Alfredo Aceves (2-10). Thome, playing in his first game since late July, was next and bounced a ground-rule double over the right-field wall and put the Orioles ahead again.
Tommy Hunter (6-8) pitched a scoreless 11th and got the win for the Orioles, who won for the ninth time in 11 games.
The Red Sox lost their fourth straight.
The Orioles took a 5-3 lead in the sixth on Ryan Flaherty's triple with two men on, then added to the lead when Jones led off the seventh with a homer.
The Red Sox loaded the bases with nobody out in the seventh, but reliever Jake Arrieta managed to limit the damage to two runs by getting Cody Ross and Ryan Lavarnway to ground into a pair of fielder's choices.
Arrieta then struck out Mauro Gomez to preserve the lead for Baltimore, but only temporarily.
Boston's Daniel Nava and Scott Podsednik hit back-to-back doubles with two outs in the eighth off of Pedro Strope to tie the score 6-6 after eight.
Mark Reynolds homer to lead off the fourth cleared the Green Monster and put the Orioles up 3-1. The Red Sox quickly tied it in the bottom of the fourth when Mike Aviles led off with a single and Danny Valencia followed with his third home run of the season.
The Orioles chased Boston starter Aaron Cook in the sixth when Chris Davis hit a one-out single, then Machado doubled on Cook's last pitch of the afternoon. Boston called in reliever Rich Hill to face Ryan Flaherty, who hit a triple to the triangle in center field and put the Orioles up 5-3.
Cook allowed five runs, all earned, on nine hits over 5 1/3 innings, walking two and striking out one.
Randy Wolf was making just his second start for the Orioles and pitched five innings, holding Boston to three runs on seven hits with a pair of walks and strike outs.
Notes: Baltimore second baseman Robert Andino was dressed but not in the lineup after being hit in the head by a pitch Friday night. The Orioles said Andino was undergoing concussion tests. ... Orioles DH Jim Thome returned to the lineup after missing almost two months with a herniated disc. ... The series is scheduled to wrap up Sunday with Baltimore RHP Chris Tillman (8-2) facing Boston lefty Felix Doubront (11-9). ... The Red Sox will host a postgame celebration Sunday as a tribute to host former player, manager and broadcaster Johnny Pesky, who died in August at the age of 92. Fenway Park, home of "Pesky's Pole" in right field, will remain open for fans who attended the game as well as the general public free of charge. ... Red Sox manager Bobby Valentine said Daisuke Matsuzaka (1-6) is lined up to start the final game of the season Oct. 3 at New York.