PHILADELPHIA -- The Phillies needed to significantly upgrade their rotation if they had any chance to catch the Nationals, Braves and Mets in 2020. Zack Wheeler should help. A source told MLB.com on Wednesday that the Phillies and Wheeler have agreed to a five-year, $118 million contract. He was considered

PHILADELPHIA -- The Phillies needed to significantly upgrade their rotation if they had any chance to catch the Nationals, Braves and Mets in 2020.

Zack Wheeler should help.

A source told MLB.com on Wednesday that the Phillies and Wheeler have agreed to a five-year, $118 million contract. He was considered the best option in the second tier of free-agent starting pitchers behind Gerrit Cole and Stephen Strasburg. Wheeler, who just might be the Phils’ most significant acquisition of the offseason, went 11-8 with a 3.98 ERA in 31 starts last season with the Mets. In 60 starts over the past two seasons, he had a 3.65 ERA and a 3.37 FIP. Based on FanGraphs and Baseball Reference, Wheeler’s WAR either made him the 10th or 19th most valuable pitcher in that span.

Multiple teams had been in pursuit of Wheeler, 29, because of his remarkable stuff and the fact that he was projected to come considerably cheaper than Cole and Strasburg. The Phillies believe Wheeler can be even better than he has been the past two seasons, particularly behind an improved Phils defense and with J.T. Realmuto catching him. MLB.com’s Andrew Simon dug into the numbers and discovered why teams see so much upside in Wheeler. He profiles comparably to Cole.

Wheeler’s four-seam fastball averaged 96.8 mph last season, which ranked fourth among starters (minimum 750 four-seam fastballs thrown). Only Noah Syndergaard (97.8 mph), Cole (97.1) and Jacob deGrom (96.9) threw harder. Wheeler’s slider averaged 91.2 mph. Only deGrom’s slider (92.5 mph) was harder. Both pitches are effective, but Wheeler’s curveball was a remarkable weapon last season. The .250 expected slugging percentage (xSLG) against the pitch ranked 14th out of 91 starters (minimum 250 curveballs thrown).

Wheeler also throws a sinker, changeup and flashes an occasional splitter. His velocity and mix of pitches generated plenty of weak contact. Wheeler's average exit velocity (86.2 mph) last season ranked eighth best out of 92 pitchers (minimum 400 balls in play), according to Statcast. His hard-hit percentage (32.2) ranked 16th.

Wheeler and Aaron Nola (3.9 WAR) should provide the Phillies a 1-2 punch they have not had at the top of the rotation since Cliff Lee (6.8 WAR) and Cole Hamels (4.2 WAR) in 2013. Philadelphia could use another starter before Opening Day, but it will not be Hamels. He wanted to return to the organization that selected him in the 2002 Draft, but he signed a one-year, $18 million contract Wednesday with the Braves.

A source told MLB.com that the Phils offered Hamels a one-year contract worth about half that.

Jake Arrieta will slide behind Nola and Wheeler. Zach Eflin, Vince Velasquez and Nick Pivetta will compete for the final two jobs in the rotation, although the Phillies could be in the market for a low-end starter on a one-year deal to provide competition and depth. Top pitching prospect Spencer Howard could make his big league debut in 2020, too.

Wheeler’s deal is the third-largest free-agent contract in franchise history behind Bryce Harper (13 years, $330 million) and Lee (five years, $120 million). Hamels (six years, $144 million) and Ryan Howard (five years, $125 million) each signed a nine-figure contract extension with the organization. Of course, any deal like this carries risk. Wheeler missed 2015 and ’16 following Tommy John surgery, but he has been relatively durable the past two seasons. He ranked 12th in innings pitched (377 2/3) in 2018-19.

The Phillies began Wednesday with a little more than $40 million to spend before crossing the luxury tax threshold. The average annual value of Wheeler’s deal leaves the Phils with more than $16 million to work with.

It likely takes them out of the running for remaining free agents like Cole, Strasburg, Anthony Rendon and Josh Donaldson.

The Phillies’ biggest need now turns to the infield. They need somebody to replace recently departed César Hernández and Maikel Franco. The Phils are interested in signing free-agent shortstop Didi Gregorius. Philadelphia manager Joe Girardi raved about Gregorius on Tuesday night at Citizens Bank Park.

If the Phillies sign Gregorius, Jean Segura, Scott Kingery and Rhys Hoskins will round out the 2020 infield. Adam Haseley is projected to be the team’s Opening Day center fielder with Andrew McCutchen in left field and Harper in right field.

Because Wheeler rejected the Mets’ one-year, $17.8 million qualifying offer in November, the Phillies will lose their second-highest pick in June’s Draft, plus $500,000 in international bonus pool money for the 2020-21 signing period.

But in the end, the Phils obviously feel Wheeler was worth it.