When the best players in the National League gathered last summer for a team photo before the All-Star Game, Bryce Harper removed his Washington Nationals cap and placed it onto J.T. Realmuto’s head.

The Nationals were then talking to Realmuto’s Marlins about a trade to acquire baseball’s premier catcher. Harper — with his gesture — made his feelings known. But the move failed to happen before last July’s trade deadline, leaving Harper a bit miffed. And now it could be Realmuto who is enticing Harper to wear a new hat.

The Phillies acquired Realmuto on Thursday, just a week before spring training as they added the player who Harper pined for while they continue to pursue Harper in this ever-slow moving offseason. Realmuto, who led all catchers last season in OPS, came with a price as the Phillies parted with top-prospect Sixto Sanchez, catcher Jorge Alfaro, minor-league left-hander Will Stewart, and international bonus-pool money.

But if this is the move that attracts Harper — or Manny Machado — to take the Phillies’ riches, then the cost will be worth it. The Phillies, according to a source, remain optimistic that they will sign Harper or Machado before the start of the season. This trade does not take them out of the running, nor was it made because they had lost out on Harper or Machado. This move, the Phillies believe, makes them more attractive.

“I think J.T Realmuto is the best catcher in baseball,” general manager Matt Klentak said. “The upgrade is pretty significant. It’s hard to acquire these types of players at any position, especially the catcher position. We knew if we were going to access J.T., we would have to give up some talent in return.”

Realmuto, who turns 28 next month, is under club control for the next two seasons. He batted .277 last season with 21 homers and a 139 OPS+, which would have been the highest mark by a Phillies catcher in 26 years. The Phillies have reason to believe his offensive production could spike at Citizens Bank Park as he batted .283 last season with 13 homers and a .870 OPS when he was away from Marlins Park.

“If that’s what he does in our uniform, then he’d still be the best catcher in baseball,” Klentak said. “But I’d be lying if I told you we didn’t think there was some chance that playing half of his games in Citizens Bank Park wouldn’t make him better. I think there’s a pretty good chance that our park could be helpful for him.”

Sanchez could develop into an elite major-league pitcher but that will likely take time. He is just 20 years old and has yet to pitch past high-A. He missed significant time last season with an elbow injury and then suffered a collarbone injury when he was trying to ready himself for the Arizona Fall League.

Last month, Baseball America ranked Sanchez as the 13th-best prospect in baseball, making him the Phillies’ best pitching prospect since Cole Hamels. The Marlins had sought another top prospect but the Phillies were able to hold them to taking Stewart, a 20th-rounder in 2015 who emerged last season in single-A Lakewood. The 21-year-old had a 2.06 ERA in 20 starts with 7.1 strikeouts per nine innings.

“It was tough to trade Sixto Sanchez and it was tough to trade Will Stewart,” Klentak said. “If you have starting pitching at the major-league level, you have the chance to win every single night. And if you have starting pitching in your system, you can access just about any player you want to access. This is where I give so much credit to our scouting department.”

Realmuto will replace Alfaro, who impressed last season as a pitch framer but struggled with his other defensive responsibilities behind the plate. Alfaro, according to Sports Info Solutions, blocked just 86.5-percent of wild pitches last season, which was the worst-rate in baseball. He was tied for the major-league lead in errors by a catcher and had the second-worst fielding percentage among all catchers.

Alfaro hit just .262 last season with a .731 OPS and ended more than a third of his plate appearances with a strikeout. Gabe Kapler tried to hide Alfaro by hitting him seventh or eighth in the lineup, where Realmuto gives the manager another option to bat in the heart of his order.

The Phillies will introduce Realmuto on Tuesday in Clearwater, Fla., after the team’s pitchers and catchers report to spring training. He will then return to the facility Wednesday for his first workout in a Phillies uniform. And that sight — with Realmuto wearing a Phillies cap — could be enough to cause a free-agent superstar to follow suit.