Steven Matz and the Cardinals finalized a $44 million, four-year contract Monday, giving St. Louis the shutdown left-hander it desperately sought for a rotation that otherwise returns intact next season.

Matz received a $2 million signing bonus, payable within 30 days of the deal’s approval by the commissioner’s office, and salaries of $8 million next season, $10 million in 2022 and $12 million each in 2023 and 2024.

Also Read | Who is Mike Shildt, the manager fired by the St Louis Cardinals?

He can earn $1 million annually in performance bonuses for innings pitched: $200,000 each for 130, 140, 150, 160 and 170. Matz also can earn $50,000 for winning the Cy Young and $25,000 for finishing second through fifth in voting, $25,000 if he is voted AL Championship Series MVP and $50,000 for World Series MVP.

“We’re excited to have Steven join our rotation and bring his experience and talents to our team,” Cardinals president of baseball operations John Mozeliak said. “Steven has proven himself to be a consistent contributor, and we think that his game will continue to excel here in St. Louis with the backing of our exceptional defense.”

The 30-year-old Matz, who is originally from Long Island, spurned the Mets to sign with a National League rival. He pitched for New York from 2015-20 before he was traded last January to Toronto, where his career-best 14-7 record and 3.82 ERA in 29 starts for the Blue Jays made him a coveted starting pitcher in free agency.

Also Read | MLB: Shohei Ohtani crowned American League MVP for two-way season

He’ll join a Cardinals rotation topped by longtime ace Adam Wainwright that also includes Jack Flaherty, Dakota Hudson and Miles Mikolas. The Cardinals also could use Alex Reyes, Jordan Hicks, Jake Woodford and Johan Oviedo.

The Cardinals were reportedly willing to give Matz a fourth year on his contract, whereas numerous other clubs were not, but they also offer arguably the best defense in baseball with five reigning Gold Glove winners: first baseman Paul Goldschmidt, third baseman Nolen Arenado, second baseman Tommy Edman, left fielder Tyler O’Neill and center fielder Harrison Bader. Arenado also won the Platinum Glove given to the best defensive player in each league.

Together, that group helped St. Louis lead the majors in runs saved last season, which in turn was a big reason why it was able to put together a club-record 17-game winning streak that allowed the Cardinals to sneak into the playoffs.

Also Read | Los Angeles Dodgers agree to sign pitcher Andrew Heaney: Reports

That wasn’t enough to save the job of manager Mike Shildt, though. He was let go soon after the Cardinals were eliminated due to philosophical differences with the front office. Oliver Marmol was promoted from bench coach to replace him.

Matz was chosen by the Mets in the second round of the 2009 first-year player draft out of Ward Melville High School in East Setauket, New York. He has a 45-48 career record with a 4.42 ERA in 136 starts and five relief appearances.

Matz also has proven to be durable, throwing at least 150 innings in each of the past three full seasons.