BALTIMORE – It was the kind of game the Baltimore Orioles have played far too many times, usually with losses.

The Orioles took an early lead Friday night against the Boston Red Sox. Then, sure enough, Baltimore fell behind in the eighth inning. Given the way the Orioles have played — and their inability to beat Boston at home — the outcome seemed predictable.

But this time Miguel Tejada tied the game with an eighth-inning homer. And after Adam Jones doubled in the 10th, Tejada singled with two outs to give the Orioles a 5-4 victory.

Baltimore pitchers issued 10 walks and allowed three homers, and the Orioles won anyway.

“Previously, all those mistakes will come back and find a way to beat you,” Manager Dave Trembley said. “They didn’t tonight. We found a way to overcome some deficiencies and some things that didn’t go our way.”

Tejada had three RBI, including that homer off Daniel Bard after Baltimore lost a 3-1 lead.

“It was really big, not only for myself to have a great game at the plate, but I think for the whole team,” Tejada said. “We just have to think we can win any kind of game.”

The win improved the Orioles’ home record to 2-8 and ended a seven-game skid against Boston at Camden Yards.

“A lot of twists and turns, but what it comes down to is getting the big hit when you need it from a guy who’s been there,” Trembley said.

J.D. Drew hit two solo homers, and Dustin Pedroia homered and drove in two runs for the Red Sox, whose three-game winning streak ended. The defeat left Boston with its first losing April (11-12) since 1996.

The Red Sox went down in order only three times, went 1 for 6 with runners in scoring position and stranded 11.

“We had our chances,” Drew said. “We left a lot of guys out there on base. That always comes back to get you.”

After Jones doubled with one out off Ramon Ramirez (0-1), Nick Markakis was walked intentionally. Hideki Okajima came in to face Matt Wieters, who struck out.

Tejada then singled up the middle off Manny Delcarmen.

“I made a couple of good pitches, and when I needed to make a pitch, I didn’t make it,” Delcarmen said. “I just left it up.”

Matt Albers (1-3) pitched a perfect 10th for the Orioles, whose 5-18 record is baseball’s worst.

It was the fourth straight one-run game between the teams, and each has won twice.

“Usually it seems like the Red Sox capitalize on everything that we do,” Jones said. “It was good that we got a couple plays.”