BALTIMORE — Orioles manager Buck Showalter had already seen plenty of wacky things happen during a wild, back-and-forth slugfest.
Then, things got really weird.
A potential double-play grounder whisked through the legs of Boston second baseman Dustin Pedroia, and Baltimore turned the miscue into the tiebreaking run in a 13-9 victory over the Red Sox on Wednesday night.
Matt Wieters had three RBIs for the Orioles, who won for the third time in 10 games despite allowing five home runs. Baltimore, by contrast, failed to go deep yet still reached a season high in runs.
Pedroia's error came in the sixth inning with the score tied at 8. After Clay Buchholz (3-6) walked Chris Davis and Mark Trumbo, Wieters hit a grounder to second. The ball skidded under Pedroia's glove, and Davis scored to give Baltimore the lead for good.
"That's when you know it's Twilight Zone night," Showalter said. "Actually, when it happened I said, 'We might have a shot.' He's one of the best second basemen you'll ever see."
Pedroia — a four-time Gold Glove winner — had two errors in 50 games this season.
"I missed it. We're not robots," Pedroia said. "It's part of the game, man. You make errors sometimes. Just wish they are not in that situation, but it's part of it."
The Orioles added another run in that inning and pulled away with a three-run seventh.
Hyun Soo Kim and Pedro Alvarez each had three hits, and Davis drew four walks for Baltimore.
Xander Bogaerts extended his hitting streak to 25 games — second-longest in the majors this season — and Mookie Betts added two homers to go with the three he clocked on Tuesday night. After connecting in the first and second innings of this game, Boston's leadoff hitter had five home runs in seven at-bats.
"I feel pretty good," he said. "Managing my at-bats well. Just riding the wave."
Chris Young also homered twice for the Red Sox, and David Ortiz had a solo shot to move into a tie with Jim Rice for third place on the team's RBI list with 1,451.
After the game, Boston optioned starter Joe Kelly to Triple-A Pawtucket and recalled right-hander Noe Ramirez from the same minor league club. Kelly allowed seven runs in 2 1/3 innings and ended the night with an 8.46 ERA.
Brad Brach (5-0) pitched 1 2/3 innings of scoreless relief for Baltimore, which pulled within two games of first-place Boston in the AL East.
Zach Britton got four outs for his 15th save.
The first three innings featured 15 runs, 17 hits and two starting pitchers fortunate to emerge from the mess with a no-decision.
Baltimore offset Betts' second leadoff homer in two games with a four-run first against Kelly, who quickly realized that earning his 11th straight win was not going to be easy.
Home runs by Young and Betts tied it in the top of the second. The Orioles went up 5-4 in the bottom half, and each team scored three runs in the third.
Baltimore starter Mike Wright yielded a career-high four home runs before being pulled with two outs in the third.
The Orioles recalled left-hander T.J. McFarland from Triple-A Norfolk and optioned rookie reliever Ashur Tolliver to the same club. Tolliver retired Betts on Tuesday when he needed a home run to tie the big league record of four in a game. On Wednesday, Tolliver said, "You never think, 'I can't give up a home run.' You just want to make sure you're locating a quality pitch."
Red Sox: OF Brock Holt (concussion) took batting practice for the first time since his injury May 19 and also participated in fielding drills for a second day. He will need a minor league rehabilitation assignment before returning, manager John Farrell said.
Orioles: There's no timetable for the return of C Caleb Joseph, who was placed on the DL with a testicular injury Tuesday after getting hit by a foul ball. "There's a lot of unknown here," Showalter said.
Red Sox: Rick Porcello (7-2, 3.68 ERA) starts the series finale Thursday night. The right-hander has gone at least six innings in his last 12 starts against AL East foes.
Orioles: Ubaldo Jimenez (2-6, 6.36) could lose his spot in the rotation if he can't turn around a skid of three starts in which he's gone 0-3 with an 11.57 ERA.