Gerrit Cole got his fifth win after setting a career-long scoreless streak, and DJ LeMahieu and Gleyber Torres hit back-to-back home runs as the New York Yankees beat the Texas Rangers 4-2 on Thursday.

The series opener marked Aaron Judge’s first game in Texas since breaking Roger Maris’ single-season American League record with his 62nd homer at the Rangers’ ballpark in October.

Cole’s scoreless streak reached 25 2/3 innings before the Rangers scored on Jonah Heim’s fielder’s choice grounder in the sixth.

With his eight strikeouts, Cole (5-0) pushed his season total to 44 Ks, one more than Rangers ace Jacob deGrom for the AL lead. He allowed two runs over 6 2/3 innings. Michael King pitched the final 2 1/3 innings for his first save.

Andrew Heaney (2-2) struck out six and walked one over six innings for Texas.

CARDINALS 6, GIANTS 0 >> Alec Burleson and Paul DeJong homered, Miles Mikolas pitched 6 1/3 scoreless innings and St. Louis avoided a four-game sweep by San Francisco.

Mikolas (1-1) scattered four hits and two walks, striking out six.

Logan Webb (1-5) allowed two runs in 6 2/3 innings with seven strikeouts, suffering his MLB-leading fifth loss of the year. San Francisco had multiple opportunities to score but went 0 for 7 with runners in scoring position and left 10 runners on base.

METS 9, NATIONALS 8 >> Jeff McNeil snapped an eighth-inning tie with an RBI triple and New York squandered a pair of multi-run leads before recovering to beat Washington.

CUBS 5, PADRES 2 >> Eric Hosmer and Nelson Velázquez hit back-to-back homers and Dansby Swanson added his first of the season to help Chicago past San Diego.

PHILLIES 1, MARINERS 0 >> Kody Clemens ripped an RBI single to right, Matt Strahm pitched scoreless ball into the sixth inning, and Philadelphia moved to .500 for the first time this season by beating Seattle.

ORIOLES 7, TIGERS 4 >> Anthony Santander’s two-run homer capped a five-run seventh inning in which Baltimore rallied for the win over Detroit.

MARLINS 5, BRAVES 4 >> Garrett Cooper came through with a two-out, two-run double that capped a stunning five-run ninth inning by Miami, which avoided a sweep with a win over Atlanta.

RAYS 14, WHITE SOX 5 >> Isaac Paredes had a career-high five RBIs, and Tampa Bay handed Chicago its eighth straight loss.

TWINS 7, ROYALS 1 >> Byron Buxton and Carlos Correa homered back-to-back for Minnesota in a rout of Kansas City.