MILWAUKEE >> Framber Valdez pitched seven strong innings and Jeremy Peña homered and drove in four runs as the Houston Astros defeated the Milwaukee Brewers 9-1 on Wednesday.

Houston earned just its second victory in seven games to snap Milwaukee’s three-game winning streak and leave both teams with .500 records. The Brewers were attempting to sweep a series from the Astros for the first time since 2012.

The Astros led 3-1 before Peña broke the game open by delivering a three-run homer to left off reliever Elvin Rodriguez with two outs in the sixth inning.

Valdez (2-4) struck out seven while allowing three hits, two walks and one run to earn his first win since the Astros’ March 27 season opener. He threw a season-high 101 pitches.

Milwaukee’s only run off Valdez came on Eric Haase’s fifth-inning homer, a 425-foot drive to center.

CARDINALS 5, PIRATES 0 >> Sonny Gray pitched seven innings of two-hit ball, and St. Louis beat slumping Pittsburgh for their fifth straight victory.

Gray (4-1) struck out eight and walked one in his first win since April 14. The right-hander went 0-1 with a 5.51 ERA in his previous three starts.

The Cardinals returned to .500 at 19-19, including a 15-6 record at home. They are 4-2 against the Pirates this year after finishing a three-game sweep.

GIANTS 3, CUBS 1 >> Robbie Ray pitched six sparkling innings, Wilmer Flores had three hits and San Francisco beat Chicago.

Ray (5-0) allowed one run and three hits in his second straight win. Camilo Doval and Tyler Rogers each got three outs before Ryan Walker handled the ninth for his seventh save.

GUARDIANS 8, NATIONALS 6 >> Carlos Santana kick-started an eight-run sixth inning with a bases-clearing double, and Cleveland beat the Nationals to win two of three at Washington in a 24-hour span.

The Guardians sent 13 men to the plate in the sixth against Michael Soroka (0-2) and relievers Jorge Lopez and Andrew Chafin. The first seven reached, and all of them scored. Leadoff man Steven Kwan scored twice in Cleveland’s biggest inning of the season.

MARINERS 6, ATHLETICS 5 >> Leody Taveras hit a game-tying two-out single in the eighth inning of his debut with Seattle before scoring the go-ahead run on Dylan Moore’s base hit and the Mariners rallied from a five-run deficit to beat the Athletics and win their ninth straight series.

Andrés Muñoz gave up a leadoff single to Luis Urías in the ninth, before striking out Jacob Wilson looking to earn his 13th save. Muñoz hasn’t allowed an earned run in 18 innings.

Taveras drove in pinch runner Miles Mastrobuoni with one out then stole second before scoring on Moore’s single off Noah Murdock (1-1).

METS 7, DIAMONDBACKS 1 >> Juan Soto homered in consecutive at-bats, Kodai Senga overcame early control problems to pitch six scoreless innings and New York beat the Arizona.

Soto hit a solo homer off Merrill Kelly (3-2) in the seventh inning and added another off Jalen Beeks in the eighth, his seventh of the season. Soto also followed Francisco Lindor’s two-run double in the ninth with a sacrifice fly to put New York up 7-1.

DODGERS 10, MARLINS 1 >> Freddie Freeman singled twice and hit a bases-loaded triple and Los Angeles beat Miami.

Freeman drove in four runs and extended his hitting streak to 12 games as the MLB-leading Dodgers (25-12) took two of three at Miami and won their fourth straight series. Freeman went 8 for 13 in the series with six RBIs and two home runs.

Shohei Ohtani tripled and drew three walks Wednesday, including an intentional pass during a six-run seventh against reliever Lake Bachar.

Pinch-hitter James Outman padded the Dodgers’ lead with a three-run homer in the ninth.

Reds 4, Braves 3 >> TJ Friedl hit two home runs and the Cincinnati Reds beat the Atlanta Braves 4-3 on Wednesday night to snap a four-game losing streak despite losing right-hander Hunter Greene to a right groin injury after only three innings.

Greene struck out six batters and allowed only two hits in three scoreless innings. He was unable to complete his warmup before the fourth inning. Greene threw only two warmup pitches, including a pitch that hit the dirt, before stopping his routine.

Royals 2, White Sox 1 >> Bobby Witt Jr. hit a two-run homer to give Michael Wacha all the support he needed as the Kansas City Royals defeated the Chicago White Sox 2-1 on Wednesday night.

It was the third straight quality start for Wacha (2-4), who allowed just three hits in seven innings, walked one and struck out five.

Phillies 7, Rays 0 >> Cristopher Sánchez allowed one hit over six innings, Trea Turner, Bryson Stott and Bryce Harper each drove in two runs, and the Philadelphia Phillies beat the Tampa Bay Rays 7-0 on Wednesday night.