The Houston Astros acquired six-time All-Star pitcher Zack Greinke from Arizona Diamondbacks for four minor-leaguers.

According to MLB.com, the Diamondbacks will get first baseman/outfielder Seth Beer, right-handed pitcher J.B. Bukauskas, RHP Corbin Martin and infielder Josh Rojas. The Astros will also receive $24 million, according to MLB Network.

Athletics-Reds

The playoff-contending Oakland Athletics have acquired starter Tanner Roark from the Cincinnati Reds, filling out a rotation that also could have left-hander Sean Manaea back soon.

Oakland dealt outfield prospect Jameson Hannah to Cincinnati. The Reds are sending Oakland $2.1 million to offset much of the $3,225,806 remaining in Roark’s $10 million salary.

The A’s began the day a half-game out of the second AL wild-card spot.

Roark lasted a season-low 3 1/3 innings during Cincinnati’s 11-4 loss to the Pirates on Tuesday. He is 6-7 in 21 starts with a 4.24 ERA and can become a free agent after the season.

Manaea struck out eight in six innings of a rehab start at Triple-A this week. He’s likely to get one more rehab start before being activated. He had shoulder surgery last September.

Nationals-Blue Jays

The Washington Nationals tried to upgrade their bullpen, acquiring relievers Roenis Elias and Hunter Strickland from Seattle and Daniel Hudson in a trade with Toronto.

The Mariners received a trio of minor league pitchers from the Nationals — left-handers Taylor Guilbeau and Aaron Fletcher and right-hander Elvis Alvarado. Washington sent minor league right-hander Kyle Johnston to Toronto for Hudson, who can become a free agent at the end of the season.

Elias has been Seattle’s primary closer for the majority of the season after Strickland suffered a lat strain in the opening week and missed several months. Strickland has appeared in just four major league games this season.

Elias has appeared in 44 games and was 4-2 with a 4.40 ERA and 14 saves for Seattle.

The 32-year-old Hudson went 6-3 with a 3.00 ERA and two saves in 45 games for the Blue Jays.

Yankees-Rockies

The Yankees got a pitcher at the deadline — for one of their Class A affiliates.

New York acquired left-hander Alfredo Garcia from the Colorado Rockies for right-handed reliever Joseph Harvey in a deal announced shortly after the 4 p.m. deadline to make deals.

The Yankees have been seeking pitching upgrades for the big league club. Garcia won’t be that, at least not this year. The 20-year-old is 2-9 with a 6.28 ERA in Class A. He’s struck out 103 in 90 1/3 innings.

Harvey pitched 10 innings out of New York’s bullpen this year as a rookie, posting a 4.50 ERA.

Phillies-Pirates

The Philadelphia Phillies bolstered their outfield by acquiring veteran Corey Dickerson from the Pittsburgh Pirates for cash and a player to be named.

Dickerson, who could become a free agent at the end of the season, hit .317 with four home runs and 25 RBIs for the Pirates. The 30-year-old missed most of the first half of the season with a strained throwing shoulder.

The Pirates acquired Dickerson from Tampa Bay on the eve of the 2018 regular season. Dickerson responded by hitting .300 with 13 home runs and 55 RBIs. He also won his first career Gold Glove for his play in left field.

Pittsburgh’s fade from contention after the All-Star break and the rise of young outfielder Bryan Reynolds in Dickerson’s absence made him expendable for a team now looking toward 2020 and beyond.

Diamondbacks-Marlins

The Arizona Diamondbacks acquired rookie right-hander Zac Gallen from the Miami Marlins for minor-league shortstop Jazz Chisholm.

Gallen, who turns 24 on Saturday, is 1-3 with a 2.72 ERA in seven starts since making his major league debut June 20. Gallen pitched at North Carolina and was a third-round draft choice by the St. Louis Cardinals in 2016

Chisholm, 21, was rated the Diamondbacks’ No. 1 prospect by MLB.com. He batted .204 with 18 homers and 13 stolen bases this season for Double-A Jackson. The native of the Bahamas is a career .253 hitter in the minors with 53 homers in 292 games since 2016.

Brewers-Rays

The Milwaukee Brewers have traded slumping slugger Jesús Aguilar to the Tampa Bay Rays, a person familiar with the deal tells The Associated Press.

The Brewers are getting right-handed reliever Jake Faria, according to multiple reports.

Aguilar was an All-Star last year, hitting 35 home runs with 108 RBIs for the NL Central champion Brewers. But the 29-year-old first baseman got off to a slow start this season and eventually lost playing time.

Aguilar is hitting .225 with eight homers and 34 RBIs this year.

The 26-year-old Faria has a 2.70 ERA in seven games for Tampa Bay.