Aubrey Huff matched his career high with four hits, including a tying two-run single, and the Baltimore Orioles came from behind twice to hand the Boston Red Sox a rare home loss, 10-6 on Tuesday night.

Baltimore rebounded from deficits of 1-0 and 6-4 and overcame homers by Manny Ramirez and J.D. Drew as the Red Sox lost for only the second time in their last 17 games at Fenway Park.

On a steamy night with a game-time temperature of 93 degrees, the Orioles scored in just three innings with four runs in the second, three in the seventh and three in the ninth. They've scored 29 runs in their last four games, three of them wins.

Huff's two-run single tied the game at 6 in the seventh and chased Hideki Okajima (1-2). Kevin Millar then hit a sacrifice fly off Manny Delcarmen.

Okajima has allowed eight earned runs in 5 1-3 innings against Baltimore, an ERA of 13.50. In his other games, he's given up just one run in 22 2-3 innings, an ERA of 0.40.

The Orioles padded the lead in the ninth against Craig Hansen, loading the bases with no outs on a single by Nick Markakis, an error by second basemen Dustin Pedroia and Huff's fourth single. Jay Payton's infield single drove in one run and Ramon Hernandez's single sent home the last two.

George Sherrill pitched the ninth but did not add to his total of 21 saves, third in the majors. After Daniel Cabrera allowed six runs in five innings, Dennis Sarfate (4-1), Jamie Walker, Chad Bradford and Sherrill held the Red Sox scoreless.

Boston rallied to take a 6-4 lead in the fifth on a two-run homer by Drew, his ninth of the year, after Pedroia was hit by Cabrera's pitch. Ramirez then hit his 15th homer of the season and 505th of his career, snapping a tie with former Oriole Eddie Murray and going into 23rd place on the career list.

In a pregame ceremony, Murray presented Ramirez with a plaque commemorating his 500th homer, hit off Bradford in Baltimore on May 31. But with two outs and the bases empty in the seventh, Bradford retired Ramirez on a popup to first baseman Millar.

Josh Beckett had just one bad inning when he gave up four runs in the second on two-run doubles by Freddie Bynum and Brian Roberts that gave Baltimore a 4-3 lead.

The Red Sox had taken a 1-0 lead in the first when Jacoby Ellsbury singled, took third on Pedroia's double and scored when Ramirez grounded into a double play.

They cut the lead to 4-3 in the third when they loaded the bases with no outs on a single by Pedroia, a walk to Drew and a single by Ramirez. Pedroia scored when Mike Lowell grounded into a forceout at second and Drew came in on another force play.

Notes:@Ramirez extended his hitting streak to 14 games and Drew to nine. ... Pedroia broke an 0-for-18 slump. ... Baltimore designated RHP Steve Trachsel for assignment and promoted 1B Oscar Salazar from Triple-A Norfolk. Trachsel was 2-5 with an 8.39 ERA in 10 games. ... The Orioles wore black armbands in memory of sportscaster Jim McKay, a minority owner of the team who died Saturday. ... The Red Sox hit consecutive homers for the sixth time this season. ... Boston just missed two homers in the third when Ramirez's shot to right and Lowell's drive to left just went foul. ... Ramirez tied Tony Perez for 24th on the all-time list with 1,652 RBIs.