BOSTON — Xander Bogaerts relaxed to the beat of his favorite walk-up song. Three pitches later, he was stunned by excitement rounding the bases.

Bogaerts hit a game-ending grand slam with one out in 10th inning, and J.D. Martinez hit his major league-leading 29th homer to carry the Boston Red Sox to a 6-2 victory over the Toronto Blue Jays on Saturday.

Mookie Betts opened the winning rally by reaching on an error against Chris Rowley (0-1) when shortstop Gurriel, who moved there in the beginning of the inning, had his grounder go right through his legs. Brock Holt had a hit-and-run single and Martinez was intentionally walked before Bogaerts hit his shot to left-center that caromed around the edge of the bleachers.

Before he came up, Bogaerts heard “X Gon’ Give It To Ya” by DMX.

“The music. I’m going to be honest,” he said, smiling. “It was a good time for it. I have certain spots where I like to hear that. It really helped me. I kind of smiled going up there.”

He said he barely recalled running the bases.

“A walk-off homer is different, a walk-off grand slam even more,” he said. “Running the bases, I didn’t even remember I hit a homer to be honest.”

It was Boston’s first game-ending slam in extra innings since Hall of Famer Jim Rice’s on July 4, 1984, and Bogaerts’ third slam of the season.

Martinez increased his major league-leading RBI total to 80 with a solo shot and red-hot Betts extended his hitting streak to 12 games with three singles to raise his majors’ best average to .362 for Boston.

“They’re tough, man,” Blue Jays manager John Gibbons said. “They got different ways they can beat you. They got a little bit of everything.”

The AL East-leading Red Sox had their 10-game winning streak halted Friday. They haven’t lost two straight since June 19 and 20.

Boston starter Eduardo Rodriguez had to leave the game with a sprained right ankle after stumbling to the ground when his left foot hit the helmet of Lourdes Gurriel Jr., who was diving into the bag on his infield hit.

“It looks bad, but we’ll see,” manager Alex Cora said. “He’s moving around which is encouraging.”

The Red Sox had tied it in the ninth when Jackie Bradley Jr. had an RBI double after Bogaerts opened the inning with a double.

Craig Kimbrel (2-1) pitched a hitless 10th for the victory.

Rodriguez, who gave up four hits with five strikeouts and no walks in 5 1/3 shutout innings, arrived nearly the same time as Gurriel and reached for a wild throw by first baseman Blake Swihart. The left-hander was on a run with three straight scoreless starts, covering 19 innings.

Blue Jays center fielder Kevin Pillar left the game with a right clavicle injury after making a diving catch on Holt’s shallow fly when he rolled before throwing to second for an inning-ending double play.

“He’s at the hospital getting checked right now,” Gibbons said.

Martinez homered over the Green Monster in the fourth off starter Sam Gaviglio, who worked on two days rest after getting tagged for six runs in 1 2/3 innings in his last start at Atlanta.

In the seventh, Toronto scored twice off reliever Joe Kelly. Kendrys Morales singled and advanced on Dwight Smith Jr.’s double. Aledmys Diaz’s run-scoring ground out into the shortstop hole tied it.

Matt Barnes then relieved and Gurriel grounded a hit-and-run single through the vacated second-base position.

TRAINER’S ROOM: Blue Jays: Closer Roberto Osuna, currently serving a 75-game suspension for violating major league baseball’s domestic violence policy, started a rehab assignment with their Gulf Coast League team Saturday and gave up one hit and struck out one in an inning. . Highly-touted prospect Vladimir Guerrero Jr. (left knee injury) played defense for the first time with the GCL team, getting in five innings at third and going 1 for 3 with a double.

Red Sox: Cora said LHP Drew Pomeranz (10-day DL, left biceps tendinitis) would make another rehab start with Triple-A Pawtucket on Wednesday. “We need the good Drew Pomeranz, the guy that can be good consistently and with his breaking ball,” Cora said. . Cora also said that knuckleballer Steven Wright (DL, left knee inflammation) is “not having great days. He’s still throwing and all that, but he’s still sore.”

RESPECT: Gibbons elected to walk Betts intentionally with a 3-0 count and a runner on first with two outs in the fifth.

ROSTER MOVES: The Red Sox recalled LHP Bobby Poyner from Pawtucket to add depth to their tired bullpen and optioned LHP Robby Scott back after he threw two innings Friday.

The Blue Jays made changes, too, recalling RHP Rowley from Triple-A Buffalo and sending down LHP Ryan Borucki, who gave up seven runs, four earned, in three innings in Friday’s win.

UP NEXT: Blue Jays: RHP Marcus Stroman (2-6, 5.90 ERA) looks to win his second straight.

Red Sox: LHP Brian Johnson (1-2, 4.23) is set to go in the series finale.