BOSTON — The Boston Red Sox are limping into a tough West Coast trip after their worst series this season.

Miguel Cabrera hit a tie-breaking home run in the ninth inning Wednesday that bounced off the top of the wall and into Boston’s bullpen, lifting the Detroit Tigers to a 4-3 victory against the Red Sox for a three-game sweep.

The Red Sox were the last major league team to be swept in a series of any length this season. They lost five of their final six on a nine-game homestand, going 4-5 during the stay.

They open an 11-game trip, starting Thursday night with the first of four against the Los Angeles Angels.

“Our ability to go out and put up a complete game is important to head out on the road where we know things are going to be more difficult, just being away from Fenway Park,” Manager John Farrell said before the game.

Boston rallied to tie it in the eighth on Mookie Betts’ RBI triple. Cabrera hit his 21st homer off Brad Ziegler (0-1).

“Unfortunately we’re one swing of the bat difference,” Farrell said.

Ziegler was surprised the ball carried out.

“I just kind of watched it in the air, it looked like it just kept getting farther and farther away,” he said. “I was, ‘What in the world?’ I didn’t think he hit it that good.”

After the Angels, Boston has four games in Seattle and three against the Dodgers in Los Angeles.

Xander Bogaerts and Dustin Pedroia hit solo homers for the Red Sox.

Boston starter Eduardo Rodriguez allowed three runs and nine hits in 51/3 innings.

“I thought he threw the ball well against a quality right-handed hitting lineup,” Farrell said.

James McCann also hit a solo homer, and Victor Martinez had four singles, a walk and drove in two runs for Detroit, which has won 5 of 7.

Tigers rookie Michael Fulmer had another solid start, giving up three runs on seven hits with three strikeouts and no walks in 72/3 innings.

Bruce Rondon (4-2) got one out for the win. Justin Wilson got the final three outs for his first major league save because closer Francisco Rodriguez was unavailable after working the past two days.

Manager Brad Ausmus said Rodriguez was away from the club “tending to a personal issue.” He expects him back Friday.

In the seventh, Fulmer gave up a solo homer to Bogaerts leading off and took a high-hop grounder from Jackie Bradley Jr. off the top of the right shoulder, but stayed in.

The Red Sox chased him in the eighth, tying it on Betts’ triple when center fielder Tyler Collins took a bad route before missing a diving attempt.

McCann made it 3-1 in the sixth, hitting a drive above the Green Monster seats.

NOTES: Red Sox closer Craig Kimbrel had a bullpen session. Farrell said he’ll have a rehab assignment Saturday with Triple-A Pawtucket. After that it’s uncertain if he’ll be activated right away. “It could be as few as one,” Farrell said. “It will be dependent physically on how Craig feels.” … Catcher Ryan Hanigan was still only available on an emergency basis after being scratched Tuesday with flu-like symptoms. … First baseman Hanley Ramirez had the day off.