BALTIMORE (AP) -- Boston put up one zero after another, its offense stuck in neutral as the game passed the 4 1/2-hour mark. Then the Red Sox got the perfect jump-start for their anemic bats: three errors by the Baltimore Orioles in the pivotal 13th inning.
Boston scored three unearned runs on just two hits in the lucky 13th and escaped with a 5-2 victory Friday night.
"We'll take them however we get them," Red Sox manager Terry Francona said. "That was kind of a loseable game. We had chances to lose that game and we didn't."
Mike Lowell had three hits, and Jacoby Ellsbury had three hits and half of Boston's club-record six stolen bases. Manny Ramirez, bidding for his 500th home run, went 1-for-6 but scored the go-ahead run.
Boston scored two runs in the first inning and didn't reach the plate again until the 13th -- thanks to the bumbling Orioles.
The miscues began when catcher Ramon Hernandez dropped a foul popup. David Ortiz was retired anyway, and Chad Bradford (2-2) came in and got Ramirez to hit a bouncer to third. Melvin Mora's throw soared over the head of first baseman Kevin Millar, and Ramirez advanced before the loose ball could be retrieved. Lowell then lined a single to left, breaking a tie that had been intact since the fourth inning.
"I just threw it away," Mora said. "If I don't play defense, we can't win the game."
Two more unearned runs scored on a throwing error by shortstop Freddie Bynum.
"Anytime you lose it doesn't sit with you very well," Orioles manager Dave Trembley said. "But obviously if you're going to get beat in this game, you'd rather have them beat you and not have it happen the way it did."
Aubrey Huff homered for the Orioles, who stranded 14 runners. Baltimore was 0-for-8 with runners in scoring position.
Some of the credit goes to the Boston bullpen, which allowed four hits over seven scoreless innings.
"You go to your bullpen in the sixth and you end up playing 13, that's a lot of zeros," Francona said. "We had to bob and weave a little bit and dodge a few, but we did."
Red Sox starter Josh Beckett struck out 10 and gave up two runs and four hits. The right-hander issued three straight walks with two outs in the sixth, but got out of the jam by striking out Adam Jones.
Baltimore's Daniel Cabrera allowed two runs and six hits in seven innings. He came in 2-9 with a 7.35 ERA in 12 career starts against Boston.
Held to one run in their previous 19 innings, the Red Sox went up 2-0 in the first. Ellsbury ended a 1-for-16 slump with a leadoff double, took third on a bunt and scored on a single by Ortiz. After Ramirez doubled to left, Lowell hit a sacrifice fly.
"A good thing, because after we scored those two it took us about 4 1/2 hours to get another one," Francona said.
Boston missed a chance to add to its lead in the second when Alex Cora botched a squeeze with Coco Crisp running from third. Cora failed to make contract, Crisp was an easy out, and the Red Sox had only one more runner advance to third base until the 13th.
Huff tied it in the fourth with his ninth home run. Beckett has allowed seven homers in his last four starts after yielding only four in his initial six outings.
Boston pitchers had 17 strikeouts. ... The Red Sox placed RHP Daisuke Matsuzaka on the 15-day DL and recalled 1B/OF Jeff Bailey from Triple-A Pawtucket. Bailey struck out in the ninth. ... Boston RF J.D. Drew did not play because of vertigo. ... Attendance was 46,199, Baltimore's second sellout of the season. ... Kevin Youkilis snapped an 0-for-18 skid with a single in the 13th. ... Plate umpire Andy Fletcher made an emphatic strikeout call on Crisp in the ninth inning, but the called strike made the count 3-2.