BALTIMORE — As the Boston Red Sox steamroll their way toward the AL East crown, the Baltimore Orioles have turned their full attention toward the wild card race.

David Price won his eighth straight decision, Hanley Ramirez homered and the Red Sox completed a four-game sweep of the sinking Orioles with a 5-3 victory Thursday night.

Boston has won eight straight to open a 5 1/2-game lead over idle Toronto in the AL East. With 13 victories in their last 16 games, the Red Sox have a magic number of five to clinch the division crown.

“That’s the Red Sox,” Ramirez said. “They know that you can chase something, want something, and we’ll go right after it. The good thing about this team is just everybody’s together, and we’ve got everything.”

Baltimore fell seven games out and dropped below Detroit for the second AL wild card. It was the first time since 2002 that the Orioles were swept at home by Boston in a four-game series.

“I think you’ve got be realistic about where we are at this point after losing four,” closer Zach Britton said. “It’s kind of time to light a fire under our butt because those other teams playing for the wild card are right there.”

Britton pitched the ninth for the Orioles, but never had a save opportunity during the four-game series.

“We should be playing better ball than what we showed,” he said. “But give them credit, too. When they’ve got everything rolling they’re a tough team to beat — just like we are. But right now everything’s not really clicking for us.”

Price (17-8) gave up three runs and six hits in seven innings, walking two and striking out five. The Red Sox have won each of his last nine starts since Aug. 7.

“That was a big win,” the left-hander said. “We’ve played good baseball, and this is the time of the year when you want your team to get on a roll the way we have, and that’s what we’ve done.”

Koji Uehara worked the eighth, and Craig Kimbrel got three straight outs for his 29th save in 31 chances.

Baltimore trailed 3-0 before Trey Mancini, starting his second major league game, hit a tying three-run homer in the third inning. It was his second home run in six at-bats.

“At the moment, it’s just an unbelievable experience,” the rookie said. “But on the flip side, after a loss like that, you don’t really think about the home run so much. It really doesn’t matter.”

Boston used a walk, a wild pitch and Andrew Benintendi’s two-out RBI single off Vance Worley (2-2) to move back in front in the fifth.

Ramirez hit his 29th homer in the seventh to make it 5-3 and send the Red Sox to their eighth straight win over an AL East foe, their longest such run since 1990.

Orioles starter Chris Tillman gave up three runs, five hits and walked three in 1 2/3 innings, his shortest outing since June 2015.

Boston got a first-inning RBI single from Ramirez and added two runs in the second, the last on a bases-loaded walk to David Ortiz that ended Tillman’s outing.

A here-we-go-again pall engulfed Orioles fans in the crowd of 26,788, but their spirits were rekindled when Mancini lined a 2-2 pitch into the seats in left field. The standing ovation continued until Price threw his next pitch.

ORTIZ FAREWELL

In a ceremony before his final regular-season game in Baltimore, Ortiz was given the phone he smashed inside the visitor’s dugout during a tirade on July 27, 2013.

Wearing a huge grin, Baltimore center fielder Adam Jones handed Ortiz the shattered phone, which was mounted on a wooden frame.

Ortiz also received a $10,000 check, made out to a charity in his name. He took the check to the dugout but left the phone on the field.

TRAINER’S ROOM

Red Sox: RHP Steven Wright (shoulder) threw from 60 feet on Thursday and was scheduled to throw from 120 feet on Friday. … LHP Henry Owens threw five innings in the Instructional League to stay sharp and was set to rejoin the Red Sox on Friday.

Orioles: RHP Kevin Gausman will have his next start delayed after experiencing discomfort near his rib cage. Dylan Bundy will start Sunday against Arizona, and the Orioles hope Gausman can pitch Tuesday or Wednesday in Toronto. … LHP Jayson Aquino was unavailable because of a viral infection.

UP NEXT

Red Sox: Winless in his last five starts, Drew Pomeranz (2-5, 4.91 ERA) faces the Rays in the start of a three-game series.

Orioles: Yovani Gallardo (5-8, 5.77) starts Friday against Arizona, which hopes to play spoiler behind struggling right-hander Shelby Miller (2-12, 6.90).