MLB: Baltimore Orioles at Boston Red Sox

Boston Red Sox relief pitcher Domingo Tapia (66) is helped off the field after a fall fielding the ball against the Baltimore Orioles in the eighth inning at Fenway Park.  

Alex Cobb threw seven quality innings in his final outing of the season as the Baltimore Orioles avoided a three-game sweep with a 13-1 rout of the host Boston Red Sox on Thursday.

Jose Iglesias, Pat Valaika and Austin Hays homered, and Hanser Alberto had three RBIs as the Orioles (24-33) won for just the second time in their past eight games. Hays, Valaika, Rio Ruiz and Ramon Urias had three hits apiece.

Cobb (2-5) allowed one run on six hits while walking two and striking out four. The victory was his first since his season debut July 25, also against Boston.

The Red Sox (22-35) had a three-game winning streak snapped in their final home game. They had outscored opponents 27-6 during that stretch.

With the victory, the Orioles moved two games ahead of the Red Sox in the battle to avoid last place in the American League East. Each team has three games remaining.

Baltimore jumped ahead quickly, Ruiz singling home a run and Cedric Mullins doubling in two during a three-run second inning. The visitors stretched their lead to 6-0 in the fourth, Iglesias going opposite field for a solo home run to cap the rally.

MLB: Baltimore Orioles at Boston Red Sox

Boston Red Sox relief pitcher Phillips Valdez (71) throws a pitch against the Baltimore Orioles in the eighth inning at Fenway Park.  

A Ruiz RBI double and Urias run-scoring single in the fifth made it 8-0 before Boston finally got on the board in the bottom of the frame when Christian Arroyo grounded into a double play with the bases loaded and no outs.

Valaika's homer made it 9-1 in the seventh. The Red Sox put runners at the corners with no outs in the bottom of the inning, but Cobb got a strikeout and a double play to escape the jam.

Ryan Mountcastle's RBI single in the eighth made it 10-1 before the Orioles added three against position player Tzu-Wei Lin in the ninth.

Martin Perez (3-5) got the start for the Red Sox and matched his season high with six runs allowed on nine hits over four innings. He walked one and struck out two.