TORONTO — Carlos Beltran hit a huge home run in the eighth inning, Andrew Miller escaped a big jam in the ninth and the New York Yankees stopped Toronto’s 11-game winning streak, beating the Blue Jays 4-3 Friday night.

Miller struck out Ben Revere and Troy Tulowitzki with runners on second and third to close out the victory. The win moved the Yankees a half-game ahead of Toronto and back into first place in the AL East.

David Price took a 3-0 lead into the eighth before New York rallied. He left after Chase Headley’s RBI double and Beltran then greeted reliever Aaron Sanchez (6-5) with a pinch-hit, three-run homer.

Ivan Nova (5-4) wound up with the win. Dellin Betances pitched the eighth and Miller finished for his 26th save, fanning Tulowitzki to end a 12-pitch at bat.

Toronto, which swept a three-game series in the Bronx last weekend, had gone 33 innings without allowing a run.

ASTROS 5, TIGERS 1: Dallas Keuchel struck out eight in seven solid innings and Jed Lowrie powered the offense with a two-run double to lead Houston in a win at home.

INDIANS 6, TWINS 1: Corey Kluber (8-12) flirted with a no-hitter for the second straight outing against Minnesota before finishing with a one-hitter in his second straight complete game as Cleveland cruised to a win at Minneapolis.

RANGERS 5, RAYS 3: Josh Hamilton homered and delivered the tiebreaking sacrifice fly as host Texas snapped Tampa Bay’s four-game winning streak.

ROYALS 4, ANGELS 1: Eric Hosmer hit a go-ahead two-run homer, Danny Duffy settled down after a wild start and Kansas City rallied for a win at home.

ORIOLES 8, ATHLETICS 6: Manny Machado hit a two-run homer in the 13th inning to give Baltimore a walk-off win at home.

NATIONAL LEAGUE

PIRATES 3, METS 2: Gregory Polanco singled home the go-ahead run in the 10th inning as visiting Pittsburgh ended the Mets’ seven-game home winning streak.

The teams went into extra innings at 1-all. Polanco singled off Bobby Parnell (1-2) and Aramis Ramirez hit a sacrifice fly against Carlos Torres.

The NL East-leading Mets scored in the bottom half on Curtis Granderson’s sacrifice fly before Mark Melancon finished for his 36th save.

BRAVES 3, DIAMONDBACKS 2: Julio Teheran pitched six strong innings and Cameron Maybin drove in two runs as Atlanta won at home.

BREWERS 3, PHILLIES 1: Wily Peralta pitched seven scoreless innings and Jean Segura dashed home on a rare two-base sacrifice fly to lift the Brewers to a win at home.

CARDINALS 3, MARLINS 1: Jaime Garcia pitched shutout ball into the ninth inning and Matt Carpenter homered in a win at St. Louis.

Garcia (5-4) came within two outs of throwing the first complete game of the season for the NL Central leaders.

INTERLEAGUE

CUBS 6, WHITE SOX 5: Chris Coghlan hit two home runs, Anthony Rizzo also went deep, and the Cubs made it eight straight wins and 14 in 15 games with a win over their crosstown rivals at U.S. Cellular Field.

The Cubs, coming off a 7-0 homestand, extended their longest win streak since a nine-game run during the 2008 NL Central championship season.

Coghlan hit a three-run homer in the top of the third, and then he and Rizzo added back-to-back solo drives off the struggling Jeff Samardzija (8-8) in the fifth to give the North Siders a 6-5 lead.