TORONTO — Pinch-hitter Marco Hernandez hit a tie-breaking home run in the ninth inning and the Boston Red Sox beat the Toronto Blue Jays 8-7 on Thursday night.

Hitting for Sandy Leon, Hernandez connected off Blue Jays closer Ken Giles (1-2), his seventh homer of the season.

Giles was pitching for the third straight game, the first time he’s done that this year. Giles missed 10 games last month because of a sore elbow.

Michael Chavis hit a three-run homer and Rafael Devers added a solo shot as the Red Sox extended their streak of games with at least one home run to eight. Boston won its sixth straight on July 4.

J.D. Martinez had three hits and Devers reached base four times as the Red Sox took 2 of 3 from the Blue Jays and improved to 5-2 at Toronto this season.

Brandon Workman (8-1) pitched the final two innings for the the win despite giving up the tying run in the eighth.

Danny Jansen homered twice for the Blue Jays, the first multihomer game of his career, and Freddy Galvis added a two-run shot. Even so, Toronto failed to win consecutive home series for the first time this season.

The Blue Jays led 6-1 through four innings but Boston reclaimed the lead with a six-run sixth.

Blue Jays left-hander Thomas Pannone was replaced after four straight Red Sox batters reached to begin the inning. Left-hander Tim Mayza came on and retired pinch-hitter Eduardo Nunez, but Christian Vazquez walked and Jackie Bradley Jr. drove in a run with a fielder’s choice. Chavis followed with a go-ahead drive to left, his 15th.

Toronto tied it on Eric Sogard’s two-out RBI double off Workman in the eighth, but Giles couldn’t keep it tied in the ninth.

Right-hander Hector Velazquez started for Boston and allowed three runs and five hits in 2 1/3 innings.

For the second straight game, the Blue Jays needed to promote a pitcher from Triple-A to fill a vacant starter’s spot. Right-hander Marcus Stroman, who left Saturday’s game against Kansas City after four innings because of a strained left pectoral muscle, was scratched Thursday.

Pannone was promoted and came on in relief of opener Derek Law, who allowed one run and two hits in two-thirds of an inning. Pannone allowed four runs and four hits in 4 1/3 innings.

Devers homered off Law in the first, his third of the series and 15th of the season, but Rowdy Tellez answered with a two-run single in the bottom half.

Jansen hit a leadoff homer in the third, then went deep again to begin the fourth. He has homered in three straight games and has six homers in his past seven. The home runs were his seventh and eighth.

NOTES: Boston activated RHP Heath Hembree (right elbow) off the injured list and optioned RHP Trevor Kelley to Triple-A Pawtucket.

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.