A day anticipated by many for months — and by some for years — became reality on Wednesday, as the Orioles traded All-Star shortstop Manny Machado to the Los Angeles Dodgers, officially beginning their rebuilding process while closing a chapter on the club’s best homegrown talent since Hall of Famer Cal Ripken Jr.

The Orioles and Los Angeles agreed to a trade that will bring back five players from the prospect-rich Dodgers farm system. Machado was informed Wednesday evening that he had been traded to the Dodgers, according to a source.

“This is a bittersweet day for the Orioles organization and the fans,” Orioles executive vice president Dan Duquette said Wednesday night. “We watched Manny grow up with our club. ... 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 an important part of this club's history, and we want to wish Manny and his family the best.”

In dealing Machado, a pending free agent who could receive a record deal in the offseason, the Orioles moved their most valuable trade chip with an eye for the future, receiving a package centered on 21-year-old Cuban outfielder Yusniel Díaz, who is the Dodgers’ third-best prospect according to Baseball America and the fourth best according to MLB Pipeline.

Along with Díaz, the Orioles will also receive right-hander Dean Kremer, third baseman Rylan Bannon, right-handed reliever Zach Pop and second baseman Breyvic Valera.

Valera will report to Triple-A Norfolk, while Diaz, Kremer, Bannon and Pop will begin their Orioles careers at Double-A Bowie.

Even though the Orioles received no major league pieces in the deal, four of the five players have reached the Double-A level, which makes for a significant haul toward the team’s rebuild considering that Machado is a two-plus-month rental.

“Really, today is the start of a rebuilding process,” Duquette said. “We aim to retool our roster and get our organization back to the competitive stature that we've been used to. We've had some good years here. We were almost able to fulfill the ultimate goal for our fans, but we didn't quite get there. But, I think now, it's clear that we have a solid strategy for the future to rebuild our ballclub."

The trade was expected to be completed shortly after Machado wore an Orioles uniform for the final time in Tuesday night’s All-Star Game at Nationals Park. A quiet day Wednesday fueled speculation that the deal hit a snag during the process of reviewing player physicals — and some Orioles deals have been voided or restructured in the past because of the team’s well-known rigid process with physicals — but the source said that the discussions to “finalize minor deal points” took a little longer because of the number of players involved.

Once Machado’s desire to test free agency became clear, so, too, did the Orioles’ need to trade him, or else risk receiving only a compensatory draft pick when he inevitably declined a qualifying offer. The team’s horrible start to the season — and its sudden drop in competitiveness, which emphasized the need for an injection of fresh, young talent — made that even more certain.

To the end, Machado, 26, embraced his tenure as an Oriole, saying that if Tuesday were the last time he wore orange and black, he’d do so dutifully.

“I’m enjoying myself,” Machado said Monday. “You look around the room, there’s a lot of All-Stars here. This year, there’s a lot of first-time All-Stars. To be a part of that, to see them in the clubhouse, to see them out of uniform, being inside the clubhouse with them and not just on the field, that’s pretty awesome. It’s always a blessing to be here. No one’s ever going to take away how much fun I’m going to have the next two days. At the end of the day, its always a blessing to represent this organization.”

With contending clubs looking to acquire Machado before the July 31 nonwaiver trade deadline, interest in Machado picked up quickly, with the Orioles fielding trade offers from eight teams: the Dodgers, Philadelphia Phillies, Milwaukee Brewers, Atlanta Braves, Arizona Diamondbacks, Chicago Cubs, Cleveland Indians and New York Yankees.

When Machado was abruptly pulled from Sunday’s first-half finale because of wet field conditions, indications were that he might be traded by week’s end. The Orioles were committed to him representing the team in the All-Star Game — had he been traded before the game, the Orioles might not have had a representative — but it became clear he wasn’t going to be an Oriole for long afterward, and certainly not when the team opened the second half in Toronto on Friday night.

The Orioles, known for their meticulousness when making any major move, were careful with their decision to trade Machado because they realized the value of the return he could bring. While considering their options with teams — the Dodgers, Phillies and Brewers emerged as finalists — they kept contingency plans open.

The buzz grew this week in Washington, where Machado was the focus in the run-up to the All-Star Game. He embraced the spotlight but acknowledged that he was ready for the trade rumors to end and to find a new home. But for many, even former Orioles slugger and current Seattle Mariners All-Star Nelson Cruz, imagining the Orioles most’ recognizable star in another uniform was difficult.

“Definitely, it will be weird, because he’s represented the Orioles for so long,” Cruz said. “He’s the face of the franchise right now. … Moving the first time is always the hardest one, because you want to stay there.”

After the Orioles shopped Machado openly last offseason, they decided instead to hold on to their best player in hopes of making one more run at the World Series with their core group. They granted Machado’s request to move from third base, where he won two Gold Glove Awards and an American League Platinum Glove as the league’s best overall fielder, to shortstop, where he’d played growing up.

But after the Orioles quickly fell out of contention, they had to consider turning the page and dealing Machado, whose rise to the majors in August 2012 coincided with the Orioles’ resurgence: three trips to the playoffs in a five-year span, including an AL East Crown and AL Championship Series appearance in 2014.

Even though it seemed necessary for an Orioles franchise that’s fallen way behind its AL East competition, the end of the Machado era in Baltimore signals a day of resignation, much like when ace Mike Mussina signed with the Yankees 18 years ago.

Machado was a fan favorite; his jersey filled Camden Yards seats more than any other’s. He was prone to the occasional blowup, but otherwise represented the city well with his youthful exuberance. He could change a game with one swing of his bat. He made playing defense cool for young fans while evoking memories of Brooks Robinson.

The Orioles recognized those talents early. They made a play at keeping him after his first full season, in 2013, a year that ended with his first of two straight season-ending knee injuries, but a deal never came together.

Machado is joining the Dodgers in the midst of the best offensive season of his career. He’s batting .315/.387/.575 with a .963OPS, 24 home runs and 65 RBIs in 96 games.

Though he has struggled at times in his transition to shortstop this season — he rates as the worst at the position in baseball by several measures — Machado and manager Buck Showalter have credited the move with helping him stay focused through perhaps the worst season in Orioles history.

Machado was just as productive through some of their recent successes, too. The third overall pick in the 2010 draft, Machado was in the majors by August 2012, and helped the Orioles clinch their first playoff appearance after 14 straight losing seasons a month later.

In his Orioles career, over parts of seven seasons since his debut, Machado hit .283 with an .822 OPS, 162 home runs and 471 RBIs. He hit 33 or more home runs in 2015, 2016 and 2017 and is well above that pace in 2018. Machado ranked 12th in baseball in Wins Above Replacement from 2012 to 2017 with 28, according to Baseball Reference.

His trade begins what’s expected to be a busy month for the Orioles, who have several other players in their last year of club control who that could be attractive to other teams, such as Zach Britton, Brad Brach, Adam Jones and Danny Valencia.

eencina@baltsun.com

twitter.com/EddieInTheYard