The months-long saga of J.T. Realmuto’s free agency came to a close on Tuesday with baseball’s premier catcher deciding to stay in Philadelphia.

Realmuto, a source confirmed, agreed to a five-year contract with the Phillies worth $115.5 million. The deal is pending a physical. Realmuto’s contract gives him the highest average annual value ($23.1 million per season) for a catcher in baseball history, surpassing former Twin Joe Mauer’s $23 million. It was his goal this winter to land a deal that raised the market for future catchers. He achieved that.

For the Phillies, retaining Realmuto was extremely vital. It was hard to see a path to the postseason, especially in a bulked-up National League East, without Realmuto. And it was even harder to see how they would market the team — in a season for which they are hoping to sell tickets — if they allowed Realmuto to sign elsewhere.

Managing partner John Middleton and president Andy MacPhail sounded pessimistic at the beginning of the offseason about the team’s chances to sign Realmuto. It was a priority, they said, but finances were complicated. In the end, the Phillies were able to make it happen.

» READ MORE: Now battling for his return to Phillies’ PA booth: Dan Baker | Bob Brookover

In two seasons with the Phillies, Realmuto has led all catchers in RBIs and wins above replacement (WAR). He was tied last season for the most home runs among catchers and had the third-highest OPS (on-base plus slugging percentage). He was the team’s lone All-Star in 2019 and has the most WAR over the last two seasons.

Sixto Sanchez, the pitching prospect in the package the Phillies traded to Miami to land Realmuto, was electric last season as a rookie. But Realmuto has been a star. Both teams have benefited from the deal.

The Phillies now have Realmuto, Bryce Harper, Aaron Nola, and Zack Wheeler under contract together for the next three seasons as they try to break a nine-year postseason drought. Among NL East foes, the New York Mets and Washington Nationals have both been aggressive this winter, the Atlanta Braves have won three straight division crowns, and the Marlins won a postseason series last year.

Reaching the playoffs remains a challenge, but the Phillies have the talent to compete.

“There’s just too many good players on the Philadelphia Phillies baseball team to be thinking about transitioning,” Dave Dombrowski, the team’s president of baseball operations, said last week. “We’re thinking about winning. That’s what we’re going to try to do. We’re going to try to do what we can. … I don’t know why we can’t compete to win. Sure, we’re not going to be the favorite to win our division with some of the other clubs there. But I haven’t always been on clubs that have been favored that have ended up winning our division. Those things get separated on the field.”

Realmuto will earn $20 million in 2021, but half of that will be deferred until 2026 and 2027 when he will receive two $5 million payments. His salary is $23.875 million in each of the final four years of the contract.

Deferring the money this offseason could give the Phillies more to spend this winter as they continue to monitor the shortstop and starting pitcher markets. They have been engaged this month with shortstop Andrelton Simmons (who is joining the Twins), and a reunion with Didi Gregorius remains a possibility.

» READ MORE: Phillies sign veteran pitcher Ivan Nova to minor-league contract

Dombrowski said last month that his offseason priorities were finding a catcher, a shortstop, and fixing the bullpen. He’s signed Realmuto and reliever Archie Bradley along with adding a cast of low-risk bullpen arms. The starting rotation could use reinforcements.

“I think ideally, we’d like to add some depth somewhere,” Dombrowski said of the rotation. “Sometimes, they’re non-roster invitees who can come in and pitch. But I think where we are, we have some young arms who we really like. I’m not sure how close they are to contributing right now. Maybe they could grow over the last year and step up. From an ideal perspective, it’s something we’re at least looking to see if we could find.”

The saga to sign Realmuto started in 2020 spring training when the Phillies won an arbitration case over Realmuto, who was seeking to earn $12.4 million after the Phillies offered him $10 million. The Phillies, Realmuto said, took advantage of an outdated system that compared catchers only to catchers.

But Realmuto wanted his stats compared to position players, believing he contributes just as much to the lineup as a first baseman or outfielder. The previous record for a catcher in his third year of arbitration was Matt Wieters’ $8.3 million in 2015 with Baltimore. Realmuto’s camp knew it would clear that bar, but it wanted to soar over it.

“If you line my numbers up with position players, that’s where our figure comes into play,” Realmuto said in February of his request of $12.4 million. “It’s never happened before where catchers go out of the catchers’ market. But it’s not in the rules that says you can’t. The team knows that they had a pretty strong case just for that and they took advantage of it.”

» READ MORE: Mike Adams goes from South Jersey men’s league to Phillies after training himself to throw 98 mph

The Phillies started negotiations with Realmuto on a long-term contract last March but paused talks once baseball was shut down by the coronavirus pandemic. The conversations never gained much momentum when the season resumed as the Phillies felt comfortable enough to wait until the winter and see what Realmuto’s market would look like.

Both the Phillies and Realmuto remained mum, but it seemed like everyone else had an opinion.

Right fielder Bryce Harper, one of Realmuto’s closest friends, wore a Realmuto T-shirt during the first days of summer training camp and shouted “Sign him” after Realmuto hit an exhibition home run. The fans outside Citizens Bank Park chanted “Sign J.T.” and hung a banner across from the ballpark’s player entrance. Harper mimicked signing a check after Realmuto homered during the season and Bradley, the reliever who signed with the Phillies earlier this month, tweeted “#SignJT” moments after his deal was official.

Realmuto’s free agency hung over the Phillies for months as his decision would ultimately decide if the team’s offseason could be labeled a success. It’s finally over, spring training begins in three weeks, and baseball’s best catcher will be in Clearwater, Fla.

“I would say I know him very well,” said Bradley, who like Realmuto is from Oklahoma. “Obviously an unbelievable big-leaguer. I played with a lot of guys who played with him and they’ve done nothing but speak so highly of what J.T. brings to the table not only on the field but off the field. I go back to when he became a free agent and looking at all the posts from his old teammates with the Phillies, and it just speaks volumes about the kind of guy he is. Great dude.”