HOUSTON (CBSDFW.COM/AP) – Alex Bregman’s two-run homer in the ninth completed a big rally to lift the Houston Astros to a 7-6 win over the Toronto Blue Jays on Wednesday.

It was Bregman’s third straight game with a homer and it capped a huge comeback for the Astros, who trailed 5-0 in the middle of the first inning after a terrible start by Dallas Keuchel.

Alex Bregman #2 of the Houston Astros hits a walk-off, two-run home run in the ninth inning to give the Houston Astros a 7-6 win over the Toronto Blue Jays at Minute Maid Park on June 27, 2018 in Houston, Texas. (Photo by Bob Levey/Getty Images)

The Astros trailed by one when Tony Kemp singled off Ryan Tepera (5-3) with no outs in the ninth and advanced to second on a wild pitch. Then with one out in the inning, Bregman sent a fastball to left field, where it bounced off the wall above the Crawford Boxes, to give Houston the victory.

Alex Bregman #2 of the Houston Astros is surrounded by teammates after hitting a walk-off, two-run home run in the ninth inning to give the Houston Astros a 7-6 win over the Toronto Blue Jays at Minute Maid Park on June 27, 2018 in Houston, Texas. (Photo by Bob Levey/Getty Images)

“That was the first guy I’ve swung and missed two straight fastballs on this year I think besides (Luis) Severino,” Bregman said. “So it kind of ticked me off.”

Manager A.J. Hinch wasn’t surprised that Bregman came through for his team.

“For him to be able to stay calm in the moment, we’ve seen this — Alex Bregman, game on the line, ice in his veins,” Hinch said.

Bregman also doubled twice on Wednesday after hitting a homer and doubling three times in a win on Tuesday night.

“I don’t know how many hits Bregman had this series but he had too many,” Toronto manager John Gibbons said.

Will Harris (3-3) allowed one hit in a scoreless ninth for the win.

After the Blue Jays took a 5-0 lead in the first, Houston scored three in the bottom of the first to close the gap and got within one Evan Gattis’ RBI double in the fifth. But Kevin Pillar singled and scored on an error in the sixth to make it 6-4.

Marwin Gonzalez snapped an 0 for 23 slump with a solo shot to the bullpen in right-center off Tyler Clippard with two outs in the eighth inning to cut the lead to one.

The Blue Jays jumped on Keuchel immediately a day after being shut out for the fifth time this season in a 7-0 loss. Randal Grichuk hit a leadoff double followed by a walk by Teoscar Hernandez. Yangervis Solarte made it 1-0 with an RBI double before Keuchel walked Steve Pearce.

Hernandez scored on a sacrifice fly by Kendrys Morales before Pillar made it 3-0 with a run-scoring single.

Another RBI single, this one on a grounder by Aledmys Diaz, pushed the lead to 4-0 before Luke Maile’s sacrifice fly made it 5-0.

Toronto starter Marco Estrada allowed seven hits and four runs — three earned — in five innings.

Keuchel, the 2015 AL Cy Young Award Winner who hadn’t allowed an earned run in his past two starts, gave up seven hits and six runs in 5 1/3 innings.

Evan Gattis doubled twice and drove in three runs to give him 30 RBIs this month, which is a franchise record for RBIs in June.

Keuchel settled down after his terrible first inning, allowing just one baserunner over the next four innings. But Pillar, who singled in the third inning, hit another single with one out in the sixth before a single by Diaz.

Keuchel walked Maile to load the bases and Toronto extended the lead to 6-4 when Devon Travis reached and Pillar scored on an error by Jose Altuve.

The Astros are in first place in the American League West division with a 54-28 record.

TRAINER’S ROOM

Astros: SS Carlos Correa sat out for the second straight day with a sore back. Manager A.J. Hinch said the problem isn’t serious but he wants to give him time to rest. … RHP Joe Smith (right elbow inflammation) threw a bullpen on Wednesday and will likely begin a rehabilitation assignment this weekend.

UP NEXT

Blue Jays: Toronto is off on Thursday before opening a four-game series against the Tigers on Friday with Marcus Stroman (0-5, 6.80 ERA) on the mound. Stroman allowed six hits in five scoreless innings in his return from the disabled list in his previous start.

Astros: Lance McCullers (8-3, 3.82) will start for Houston in the first of four games at Tampa on Thursday night. McCullers allowed four hits and three runs while fanning nine in six innings in his previous outing.

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)