The Brewers traded shortstop Jean Segura to the Diamondbacks on Saturday.

The Brewers completed a major trade with the Diamondbacks on Saturday evening that was as much about clearing the way for the organization’s top prospect as it was about the players they received in return.

Milwaukee sent underperforming shortstop Jean Segura and young pitcher Tyler Wagner to Arizona in exchange for starter Chase Anderson, veteran infielder Aaron Hill, minor-league shortstop Isan Diaz and cash. The money will help compensate for Hill’s $12 million salary.

Anderson, a ninth-round pick in the 2009 draft, is 28 years old but has only played two seasons in the majors and is not yet eligible for salary arbitration. He went 6-6 with a 4.30 ERA in 27 starts for the Diamondbacks last year. Hill, 33, has played 11 big-league seasons with Toronto and Arizona. He is a career .268 hitter with 151 home runs and 650 RBI in 1,400 games; most of his time has been spent at second base but he’s also played third base and shortstop. Hill has a career .429 batting average at Miller Park.

Diaz, a 19-year-old who completed his second professional season, was the Pioneer League Most Valuable Player in 2015. He batted .360 with 13 homers, 51 RBI and 12 stolen bases in 68 games at Rookie Missoula, leading the league in doubles, slugging percentage, total bases and extra-base hits.

“In Chase Anderson and Aaron Hill, we are adding two proven major-league contributors who will impact our team this year,” said Brewers general manager David Stearns. “Chase is a young starting pitcher who has already enjoyed success at the major-league level. Aaron has a long history of production and positional versatility.

“In addition, we are excited to be able to add Isan Diaz to our growing supply of high-upside minor-league talent.”

Milwaukee said goodbye to the 25-year-old Segura, who they acquired from the Angels in 2012. After a productive first year and a half, he struggled at the plate the last couple of seasons, batting .257 in 142 games in 2015. Wagner, 25, was regarded as one of the Brewers’ better young pitchers, owning a 35-23 record and a 2.95 ERA in 91 games (including 88 starts) in the minors. He made his major-league debut last season, starting three games and going 0-2 with a 7.24 ERA for Milwaukee.

Even though he is young and controllable for three more years, the Brewers had been actively looking to trade the disappointing Segura. Their top prospect, Orlando Arcia, is a shortstop that is close to reaching the majors. He’s expected to start 2016 at Triple-A Colorado Springs but could be promoted during the season. Considered one of the best prospects in the minors, he hit .307 at Double-A Biloxi last year.