President Donald Trump stood next to Mariano Rivera, the former New York Yankees relief pitcher and Hall of Famer, before they walked side-by-side in a packed East Room of the White House with Metallica's "Enter Sandman" blaring overhead.

On one side, the greatest closer in baseball history. On the other, the self-proclaimed titan of deal-closing.

It was mid-September, and Trump was about to present Rivera with the Presidential Medal of Freedom. It would mark the culmination of a decadeslong relationship between the president and the Yankees organization — one that has involved some of Trump's most important relationships and exposed him to leadership tactics he deploys to this day.

"The Sandman," Trump said of Rivera as the Metallica hit played, just like it did when Rivera would enter games. "My wife asked me, 'Why 'The Sandman?' Just tell me.' Our first lady. I said, 'Because he put the batter to sleep, right?' 'The Sandman.' A lot of people don’t know that, but the Yankee fans know that. We've watched it for a long time."

President Donald Trump presents the Medal of Freedom to former New York Yankees pitcher Mariano Rivera during a ceremony in the East Room of the White House on Sept. 16, 2019. Al Drago / Reuters file

A Yankees fan for years, Trump would know. But his relationship with the team far predates Rivera's on-field heroics and led to his decades-old relationship with George Steinbrenner, the Yankees owner known colloquially as "The Boss" and a man Trump said was his best friend. Steinbrenner died in 2010.

"He and George were very good friends," Randy Levine, who was president of the Yankees for two decades and who late last year found himself under consideration to be the Trump's chief of staff, told NBC News.

Download the NBC News app for breaking news and politics

Levine noted that Steinbrenner would often invite Trump to watch games with him in the owner's suite.

"He sat at a big round table and others would join him," Levine said. "The president would sit there with George. Other people, such as Yogi would often join them," he said, referring to another Yankees Hall of Famer, Yogi Berra.

Donald Trump, at the behest of Yankees' owner George Steinbrenner, speaks at the Boys and Girls Club of Greater Tampa's annual Steak 'N' Burger benefit in Tampa, Fla. on Aug. 19, 1988. Victor Junco / St. Petersburg Times via Getty Images file

"George always used to say we had a great record when Donald was at the table with him," Levine said. "And because George was superstitious, especially during the playoffs, he would always call Donald to make sure he was there. George believed he was good luck."

Perhaps no contemporary displayed a leadership style as similar to Trump's as Steinbrenner, who first popularized the phrase "you're fired," one Trump would make a hallmark in his decade on "The Apprentice." Famously difficult to work with — particularly early in his tenure as Yankees owner — Steinbrenner would hire and fire top employees seemingly on a whim. He waged battles with his staff and his players in public. He was the model for chaos agent as CEO.

Steinbrenner cycled through managers at a pace never seen before. Trump, who is also known for both privately and publicly berating his employees, is running an administration with a record-level turnover rate.

Steinbrenner won, though there were many bumps along the way. In his nearly nearly four decades running the Yankees, the team captured seven World Series titles.

As Levine said, Trump and Steinbrenner "were very different in ways, but very similar, very out front" and "very strong."

Others had a slightly different take.

"They were the same person when they were born," Peter Golenbock, author of "George: The Poor Little Rich Boy Who Built the Yankee Empire," a critical 2010 Steinbrenner biography, told NBC News. "They were narcissistic and that's the thing that really ties the two of them together is their narcissism, and it's an extreme narcissism in both of their cases."

Both Trump and Steinbrenner got their start in their family's business, and both sought to move out from under the shadows of their fathers. As they became close in the 1980s, the two men ran in a circle that included businessmen like limousine executive Bill Fugazy and Chrysler CEO Lee Iacocca. The combative attorney Roy Cohn counseled them both.

"And I think he learned from those guys," Levine said of Trump.

Yankee's owner George Steinbrenner, center, and former President Richard Nixon, end right, attend the funeral of Billy Martin at St. Patrick's Cathedral in New York, Dec. 29, 1989. Mark Lennihan / AP file

Like Trump, Steinbrenner, who was suspended multiple times from overseeing the Yankees, had a nose for controversy. The first suspension came in the mid 1970s when he was convicted of making illegal campaign contributions to President Richard Nixon, something for which Steinbrenner would receive a presidential pardon for years later. The second came in the early 1990s after the Yankees owner paid to dig up dirt on his star player Dave Winfield.

"I mean it's amazing how Steinbrenner showed all those same characteristics that Trump does, that he was one of these people who didn't take advice from anybody," Golenbock said. "He was the smartest guy in the room. He knew better than any general manager. He knew better than any manager. He knew better than anybody."

"You talk about somebody who loved the notion of 'you're fired,' which is what Trump was known for," Golenbock said. "Ten years of that TV show where he relished in firing people. Well, Steinbrenner was exactly the same way."

And the similarities between the Winfield episode and Trump's efforts at digging up dirt on former Vice President Joe Biden in Ukraine⁠ — now the subject of Democrats' impeachment inquiry⁠ — were not lost on Golenbock.

"The parallels are just uncanny," he said.

Marty Appel, a former Yankees public relations executive and author of several books on the team, acknowledged "similarities in their bombastic approach," but told NBC News the comparisons should end there. Steinbrenner, Appel said, "could be a difficult boss, he could be pretty hardheaded on things sometimes, but at the end he was a decent person who was right as a businessman."

Donald Trump throws the first pitch before the start of the second game of an American League double header between the Boston Red Sox and New York Yankees at Fenway Park in Boston on Aug. 18, 2006. Jessica Rinaldi / Reuters file

"I think really, he just took from Steinbrenner the capital B in 'The Boss,'" Appel added of Trump. "You're the boss, do whatever you want. He's gone beyond the realm of what's appropriate."

The president has seamlessly transitioned from his Yankees days to the White House. Even before, as a candidate, Trump touted the endorsements of prominent former players. At a Florida rally days before the 2016 election, Trump had former Yankees outfielder Johnny Damon deliver an introductory speech. Months earlier, he shouted out another former Yankees outfielder, Paul O'Neill, during a press conference at a primary victory party in Florida. "I love you," Trump said after asking O'Neill for his support.

In the years that followed, Rivera — who now serves as a co-chair of the President’s Council on Sports, Fitness, and Nutrition — and Damon have become recurring guests on "Fox and Friends," one of the president's favorite TV programs.

"I think the president’s a Yankee fan," Levine said. "Rumor is he started out as a Mets fan, but he got converted because of his relationship with 'The Boss.' Genuinely, I think he loves sports. I don’t think politics enters into it when it comes to sports."

In the years preceding his presidential run, Trump was routinely spotted at Yankee Stadium sitting alongside contemporaries like former Fox News host Bill O'Reilly and ex-New York City Mayor Rudy Giuliani, now Trump's attorney. Famous Yankees like Alex Rodriguez, Derek Jeter and Hideki Matsui bought apartments in Trump buildings. When Rodriguez and Jeter sold those apartments, Trump was quick to attribute poor play or injury to their decision to sell. In that vein, the future president held little back in offering his unvarnished thoughts on the team through his Twitter account.

Donald Trump meets New York Yankees manager Billy Martin, right, at Municipal Stadium in West Palm Beach on March 26, 1988. Seated with Trump are his son Donald, 10, with a ball given him by Martin and Yankees owner George Steinbrenner during the game with the Montreal Expos. Richard Drew / AP file

"The Yankees are sure lucky George Steinbrenner is not around," Trump wrote in 2013. "A lot of people would be losing their jobs."

Giuliani's son, Andrew, a White House official, offered NBC News his assessment of what ties the president and the Yankees together.

"American icons and winners," he said.

There's little doubt Trump sees it the same way. If he could own any major sports team — something he sought in his pre-presidential life — the answer was simple.

"I would really always say the Yankees," he said in 2015.

The senior Giuliani, who has for the past year and a half served as the president's personal attorney, said he and Trump frequently discuss the team, adding that Trump "was just about at every Yankee game that I was at when I was the mayor."

Asked if Trump would join him behind home plate at Yankee Stadium, where Giuliani is often spotted watching the team, he said, "I think he would love it."

Then Giuliani added, "I think the Secret Service would go nuts."