Manny Machado takes a selfie with Matt Kemp. (Patrick Smith/Getty Images)

Leading off the second inning Tuesday night, Los Angeles Dodgers outfielder Matt Kemp roped a double to left field. After Kemp strolled into second base, American League shortstop Manny Machado pulled a phone from his pocket and snapped a selfie of himself and Kemp. They were technically opponents, and Machado wore a Baltimore Orioles cap, but both men knew they were virtually teammates.

The Kemp-Machado picture was further confirmation of what had become an open secret at the All-Star Game: A blockbuster trade of Machado to the Dodgers for a package of minor league prospects was in the works, with the details likely to be hammered out and finalized by Wednesday.

The Orioles, under the guidance of owner Peter Angelos, are notoriously obsessive about the medical reports of potential acquisitions, which makes their proposed trades less ironclad than those of other teams. Still, Baltimore all but confirmed the deal after Machado exited the All-Star Game for a pinch hitter, tweeting a highlight with the text, “You’ve done us proud, Manny.”

Machado, the 26-year-old mega-free-agent-to-be who led the Orioles to three playoff appearances from 2012 to 2016, tips the balance of power in the National League back toward the defending pennant winners.

The Dodgers became the most logical suitor for Machado when they lost star shortstop Corey Seager to elbow surgery in May. After a rocky start, the Dodgers stabilized and entered the all-star break leading the NL West by a half-game over the Arizona Diamondbacks. Machado, hitting .315 with a .963 on-base-plus-slugging percentage and 24 home runs, fills a clear need with a superstar.

“We’ve got a great locker room, and I think he would fit right in,” Dodgers all-star pitcher Ross Stripling said Tuesday afternoon. “And obviously you put that bat in the middle of our lineup, it makes things pretty special.”

The Orioles had no choice but to trade Machado, perhaps the greatest player in franchise history since Cal Ripken Jr. They have bottomed out at 28-69 and sit a staggering 39½ games behind first-place Boston in the American League East. Baltimore will probably follow with a trade of closer Zach Britton, a needed step to bolster a widely derided minor league system.

The Orioles had been weighing offers on Machado for weeks, with the Philadelphia Phillies — a certain pursuer of Machado this winter — and the Milwaukee Brewers reportedly making serious offers.

The Athletic’s Ken Rosenthal reported the Machado trade was “happening,” with 21-year-old Class AA outfielder Yusniel Diaz the centerpiece of the swap. Diaz blasted two home runs Sunday in the Futures Game at Nationals Park.

Machado had grown weary of questions regarding his future, which reached an awkward apex Tuesday afternoon. With rumors circulating all morning of a possible trade, a horde of reporters flocked to his locker in the visitors’ clubhouse.

“This is probably going to be the last one I answer,” Machado said. “There will be a time and place where I’ll be here again, answering questions if it happens or it doesn’t. But for now, I’m just trying to worry about today, not try to worry about anything else. I just try to go out there and enjoy myself as much as I can.”

The day ended with more clarity. Machado will now chase a World Series in Los Angeles, a large platform from which to build his value. Machado will probably sign one of the richest contracts in baseball history this winter.

He should fit into his proposed new home. He entered Nationals Park early Tuesday afternoon in a cream suit, with no shirt under his jacket and a giant gold chain around his neck.

“Did you see what he wearing today on the red carpet?” Kemp said Tuesday afternoon. “That’s Hollywood, man.”