The Boston Red Sox signed right-handed reliever Garrett Whitlock to an $18.75 million, four-year deal Sunday covering 2023-26 that includes two club options and escalators that could increase the total to $44.5 million over six seasons.

The agreement was announced by chief baseball officer Chaim Bloom before Boston played the finale of a three-game series against the rival New York Yankees.

The Red Sox poached Whitlock from the Yankees in the winter meeting draft ahead of the 2021 season. A starter in the minors, the 25-year-old Whitlock moved to the bullpen and led all Boston pitchers with a 1.96 ERA over 73 1/3 innings. He was 8-4 with 81 strikeouts and 17 walks while frequently pitching multiple innings per appearance.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

"We hope we're just scratching the surface of what he can accomplish," Bloom said. "The fact that, he's said a few times, you give him the ball and he'll get outs until you take it from him, that's perfect."

Garrett Whitlock #72 of the Boston Red Sox delivers during the sixth inning of the 2022 Major League Baseball Opening Day game against the New York Yankees on April 8, 2022 at Yankee Stadium in the Bronx borough of New York City.  (Maddie Malhotra/Boston Red Sox/Getty Images)

Whitlock was an 18th-round draft pick by New York in 2017 and had Tommy John surgery in 2019. When the 2020 minor league season was canceled due to the pandemic, he coached a travel-ball team and worked landscaping to make ends meet back home in Alabama.

The Yankees left him unprotected the next offseason for the winter meeting draft, and Boston took a chance on him.

Among 30 rookies who pitched at least 70 innings in 2021, Whitlock ranked first in ERA, second in WHIP at 1.10, and third in opponent OPS at .631.

"Last year when they took me in the Rule 5 draft, it was an honor then, just because the fact they took a chance on me, everything like that," Whitlock said. "I just want to work my tail off."

Bloom said the sides agreed to the deal hours before Boston's season-opener Friday. Whitlock made his season debut that day, allowing a run over 2 1/3 innings in relief against New York, striking out four and allowing a homer to DJ LeMahieu in a 6-5 defeat.

Whitlock had agreed last month to a one-year contract paying $720,000 while in the major leagues and $285,250 while in the minors.

The new deal includes a $1 million signing bonus, $1 million in 2023, $3.25 million in 2024, $5.25 million in 2025 and $7.25 million in 2026. Boston has an $8.25 million club option for 2027 with a $1 million buyout and a $10.5 million option for 2028 with a $500,000 buyout.

The options have up to $4 million each in esclators for innings and awards, such as Cy Young Award and Mariano Rivera/Trevor Hoffman reliever of the year. Whitlock remains eligible for the new $50 million bonus pool for pre-arbitration-eligible players.