The Los Angeles Dodgers have won the Manny Machado sweepstakes, garnering the prized All-Star shortstop from the Baltimore Orioles in a trade Wednesday night.

A person with knowledge of the deal confirmed the trade to The Associated Press. Another person with knowledge of the trade said the Orioles will receive five prospects: outfielder Yusniel Diaz, right-hander Dean Kremer, third baseman Rylan Bannon, righty Zach Pop and third baseman Breyvic Valera. The people spoke on condition of anonymity because the deal has not yet been announced.

Machado, a power-hitter with extraordinary fielding skills, greatly improves the Dodgers’ chances of reaching the World Series for a second consecutive year. He led Baltimore in batting average (.315), home runs (24) and RBI (65).

Machado’s contract expires at the end of the season, and the last-place Orioles decided against negotiating an expensive, multiyear extension because they have too many holes as the team moves into a rebuilding mode.

Though only a summer rental, Machado was coveted by a variety of contenders, including Philadelphia, Milwaukee, the Chicago Cubs and Arizona, currently a half-game behind the first-place Dodgers in the NL West.

Los Angeles gets a four-time AL All-Star with two Gold Gloves who has 129 homers over the last three seasons. Machado was drafted third overall by the Orioles in 2010 and made his big league debut in 2012.

BREWERS: Pitcher Josh Hader will be required to go through sensitivity training after years-old racist and homophobic tweets of his resurfaced during the All-Star Game, Major League Baseball said.

MLB announced that the commissioner’s office would require Hader to participate in diversity and inclusion initiatives in addition to the sensitivity training. In a statement, Brewers GM David Stearns said the team would continue to work through the issue with Hader.

Several of Hader’s tweets from 2011 and 2012 came to light Tuesday night while Hader was pitching in the All-Star Game. Hader learned of the situation when he left the game, apologized and took responsibility for the tweets, saying they did not reflect his values or the person he is now.

Hader, 24, said he did not “vividly” remember the tweets.

“Being 17 years old, you make stupid decisions and mistakes,” Hader said Tuesday night. “I was in high school. We’re still learning who we are in high school. You live and you learn. This mistake won’t happen again.”

Stearns said the Brewers were in contact with Hader, who is “fully aware of the severity of the situation related to his social media comments, regardless of the timeline of his posts.”

“His comments are inexcusable, and he is taking full responsibility for the consequences of his actions,” Stearns said. “In no way do these sentiments reflect the views of the Brewers organization or our community.”

ANGELS: The Los Angeles Angels publicly praised Mike Trout “for prioritizing his personal values over commercial self-promotion” a day after baseball Commissioner Rob Manfred said the All-Star outfielder would be an even bigger star if he would spend more time marketing himself.

The team released a statement congratulating Trout on his performance in the All-Star Game then extolled the time he spends visiting hospitals, schools and charities and the time he spends with family.

A day earlier, Manfred said MLB was interested in having players more engaged and in helping players develop their individual brands. Manfred said Trout chooses not to spend his down time marketing.