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

The Orioles received five prospects: outfielder Yusniel Diaz, right-handers Dean Kremer and Zach Pop, and third basemen Rylan Bannon and Breyvic Valera.

Machado, a 26-year-old 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 RBIs (65).

Machado is expected to be introduced in Milwaukee on Friday before the Dodgers open a series against the Brewers.

"We viewed Manny Machado as a big difference maker," Dodgers general manager Farhan Zaidi said.

The Dodgers are in a close race in the NL West, leading Arizona by a half-game going into the second half.

"Our first hope is we have a division-winning roster," Zaidi said. "Any time you have a chance to add an impact player in a tight division race that's something you have to look at closely."

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

"We tried to maintain a competitive club this year, and that's why we resisted the offers we had in the offseason to trade Manny," Dan Duquette, the Orioles' executive vice president of baseball operations, said. "But when it became obvious that it was time to look to the future, trading Manny is the first step in the plan to rebuild our ballclub."

Asked if the Dodgers would re-sign Machado, Zaidi demurred.

"Let's have him at least show up in a Dodger uniform before we start asking those questions," he said. "We hope he plays well and creates a good market for himself. We're not worried about what happens past 2018."

Though only a summer rental, Machado was coveted by a variety of contenders, including Philadelphia, Milwaukee, the Chicago Cubs and Arizona.

"We liked the depth of the Dodger package, we liked the quality of the players in the package and we liked Yusniel Diaz, a player we feel is a gifted hitter," Duquette said. "We felt he was clearly the best player offered to us during this recent market. He was the key to the trade. But the other players in the trade are also very talented."

The 21-year-old Diaz hit two home runs in the All-Star Futures Game last weekend. He's hitting .314 with a .905 OPS with six homers, 30 RBIs and 36 runs scored this season.

Duquette said Valera will be optioned to Triple-A Norfolk, and the other four players will be sent to Double-A Bowie.

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

"Obviously, it's a bittersweet day for our organization," Duquette said. "We watched Manny grow up in our franchise the past eight years. We all know what an exceptional talent he is, from the great plays that he made to his elite hitting. He's always going to be a part of our important part of our club's history."

The Dodgers are filling a gaping hole at shortstop created by the loss of Corey Seager, who is out for the season after undergoing Tommy John surgery in May.

And Machado moves from a cellar-dweller to a division-leading club in the middle of a pennant race. Not only that, but Machado likely gets to stay at shortstop, the position he manned this year after previously playing third base for Baltimore.

"I love playing short. I mean, I love it," Machado said last week. "I'm more excited playing shortstop than I've ever been. I'm more into the game. This is where I've always wanted to be, this is what brings the best player out of me."

Zaidi said Dodgers manager Dave Roberts has explained to Machado about how much the team values flexibility and versatility in playing different positions.

"Manny being flexible with that and being able to move between shortstop and third, we believe he can be an asset at both those positions," Zaidi said. "When JT (Justin Turner) is down, Manny's ability and willingness to play third base on those occasions will be really important going forward. Everybody is sort of on the same page about that."

Chris Taylor has been playing shortstop for the Dodgers, but his numbers are down from last season.

With Machado at short, the Dodgers could move Taylor to second instead of Logan Forsythe, offensive sensation Max Muncy to first, last year's Rookie of the Year Cody Bellinger to center and still have Enrique Hernandez available to play numerous infield and outfield positions.

The Dodgers still need to bolster their bullpen, which has been hit by a number of injuries.

"We're going to continue to look for upgrades," Zaidi said.

With a 28-69 record, the Orioles approach the July 31 non-waiver trade deadline in full selling mode for the first time in seven years. Machado might not be the only one leaving, either. Three other solid players in the final year of their contracts —outfielder Adam Jones, lefty Zach Britton and right-hander Brad Brach— could also be headed elsewhere.

"At this time of year, the competitors are looking for the veterans that have been seasoned in pennant races, as have our players," Duquette said. "We're going to look to maximize that opportunity on the market and try to find as many good young players as we can to deepen our farm system."

More From 1460 ESPN