BOSTON (AP) — Adrian Beltre had a tiebreaking sacrifice fly in the ninth inning after Texas blew a late four-run lead and the Rangers beat the Boston Red Sox 10-9 Wednesday.

Josh Hamilton homered among his three hits and had four RBIs for Texas, which couldn’t hold a 9-5 edge before pulling out its sixth win in eight games.

Mitch Moreland, Nelson Cruz and Geovany Soto also homered for the Rangers. It was Soto’s first with Texas since being acquired from the Chicago Cubs in a non-waiver deadline deal last week.

The AL West-leading Rangers took two of three from Boston, closing their road trip at 4-2.

Will Middlebrooks had a three-run homer for the second straight game, and Cody Ross added a solo shot and drove in two runs for Boston, which has lost six of eight and went 4-6 on its longest homestand of the season.

Adrian Gonzalez added three RBI doubles for the Red Sox.

It was only Hamilton’s fourth multi-hit game in his last 27. Before Wednesday, he had just two homers and 16 RBIs since the All-Star break.

Alexi Ogando (2-0) worked two perfect innings of relief for the win. Joe Nathan pitched the ninth for his 23rd save, striking out the last two batters with a runner on second.

With the score tied 9-all, Elvis Andrus walked and moved to third on Hamilton’s single off Clayton Mortensen (1-1). Alfredo Aceves relieved before Beltre’s sacrifice fly.

Josh Beckett gave up a season-high eight runs on eight hits — three homers — in his first start for Boston since leaving July 31 with a back spasm. It’s the seventh time he’s given up eight or more runs at Fenway Park, four times against the Yankees, the last coming May 7, 2010.

Trailing 9-5 in the seventh, Boston tied it when Gonzalez had his third run-scoring double and Middlebrooks homered into the left-field seats off reliever Roy Oswalt.

The Rangers had chased Beckett and built an 8-5 lead in the sixth. Soto homered into the seats above the Green Monster after David Murphy singled. Beckett was booed loudly as he walked slowly off the mound after being pulled.

Cruz’s homer off Mortensen made it 9-5 in the seventh.

With the score tied 3-3 in the fifth, Moreland led off with a homer off a TV stanchion in straightaway center. Andrus singled before Hamilton hit a shot deep into the right-field seats for his 30th home run, making it 6-3 and giving the slugger his third season of 30 or more homers.

Beckett’s career-best streak of starts without surrendering a home run was halted at 12. It was the longest in the majors’ this season and most by a Red Sox starter since Mel Parnell’s 14 straight in 1948.

Gonzalez’s second RBI double had cut the score to 6-4 in the fifth. Texas starter Matt Harrison then loaded the bases with consecutive two-out walks before he was lifted for Oswalt. Gonzalez scored on catcher Soto’s passed ball, slicing it to 6-5, but Kelly Shoppach struck out to end the threat.

Harrison was charged with five runs — four earned — on eight hits in 4 2-3 innings.

The Rangers’ continued Beckett’s season-long first-inning misery, jumping ahead 3-0. Hamilton had a two-run triple into the center-field triangle and scored on Beltre’s sacrifice fly.

Beckett’s ERA rose to 10.42 in the first innings of his starts.

In the first, Gonzalez’s RBI double and Ross’ run-scoring single made it 3-2.

Ross’ homered in the third — his first in 18 games — just inside the left-field foul pole, tying it at 3.

NOTES: It was just Hamilton’s second homer in his last 19 games. … Red Sox DH David Ortiz, on the 15-day DL since July 18 with a strained right Achilles, did some agility drills and looked good running the bases about two hours before the game. On Tuesday, he took batting practice on the field and said he hopes to return when the club plays in Cleveland this weekend. … Boston placed RHP Vicente Padilla on the 15-day DL before the game with right arm tightness and recalled RHP Mortensen from Triple-A Pawtucket. … The Rangers put C Yorvit Torrealba on waivers. If he’s not claimed by Friday he’ll become a free agent. He was designated for assignment when the club acquired Soto from the Cubs on July 31.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.