The Twins have agreed to terms on a deal with veteran lefthander Zach Duke, a major league source said Monday.

The deal is pending a physical. Duke, who turns 35 on April 19, pitched last season for the St. Louis Cardinals, going 1-1 with a 3.93 ERA in 27 relief outings.  He gave up 13 hits, including three home runs, and six walks in 13⅓ innings while striking out 12.

Duke will sign a major league contract. The Twins currently have one open spot on their 40-man roster, meaning that once Duke joins they would have to jettison someone should they sign any more free agents this offseason.

Duke did not make his 2017 debut until July 21, but the fact he was able to pitch at all last season was somewhat surprising, given that he had Tommy John elbow ligament replacement surgery in October 2016.

Recovery from the surgery typically takes at least one year. According to FanGraphs, Duke’s return, 287 days after his surgery, was the fastest of any major league pitcher in the previous decade.

That surgery came after an effective 2016 with the White Sox and Cardinals, when he went 2-1 with a 2.36 ERA in 81 games, pitching 61 innings.

An All-Star starter in 2009 with Pittsburgh, Duke has pitched almost entirely out of the bullpen since 2012. For his career, he is 61-85 with a 4.30 ERA pitching for  the Pirates, Diamondbacks, Nationals, Reds, Brewers, White Sox and Cardinals.

Duke has never been a hard thrower, with a fastball average of just 89 miles per hour during his career, and a strikeout rate of 5.5 per nine innings. But his slider and sinker are particularly effective vs. lefthanders, and his strikeout rate has jumped since going to the bullpen as a lefty specialist. In the past five seasons, lefthanded hitters have hit .226 with a .293 on-base percentage and six home runs in 371 at-bats off him, and Duke has struck out 10.3 batters per nine innings.

Duke will join fellow Taylor Rogers, Gabriel Moya and Buddy Boshers as candidates for lefthanded roles in the Twins bullpen.

He will be the third free-agent pitcher to sign with the Twins this winter, joining Fernando Rodney and Michael Pineda — both of whom also have had Tommy John surgery. They join a pitching staff that already includes previous Tommy John patients Kyle Gibson, John Curtiss and Trevor May; Yu Darvish, rumored to be another Twins’ target in free agency, has also undergone the procedure.

Staff writer Phil Miller contributed to this report.