The Minnesota Twins and starting pitcher Michael Pineda agreed Thursday to a two-year, $20 million contract to bring the right-hander back after a suspension for a banned diuretic, according to a person familiar with the negotiations.

The person spoke to The Associated Press on condition of anonymity, because the deal had not been announced and was subject to a successful physical exam.

Pineda went 11-5 with a 4.01 ERA in 146 innings over 26 starts for the Twins in 2019, his first season with the team, before Major League Baseball announced Sept. 7 a 60-game suspension for a positive test for hydrochlorothiazide, which can be used for weight loss and blood pressure management. It's outlawed because it can mask the presence of steroids.

That kept Pineda out of the postseason for the American League Central champion Twins, who were swept in three games in the Division Series by the New York Yankees. Pineda, who will turn 31 next month, will have 39 games left on the suspension to serve before he can take the mound for the Twins in mid-May.

Pineda, who is 6-foot-7 and 280 pounds, missed half of the 2017 season while with the Yankees and the entire 2018 season after signing with the Twins following Tommy John surgery. He said he took an over-the-counter medication given to him by an acquaintance, not realizing the pills contained the banned substance. He apologized then to the organization, his teammates, his family and Twins fans for his judgmental error and said he did not intend to cheat.

“The last two years I’ve had two surgeries, so that made me gain some weight," Pineda said. "I was just trying to find a way to control that so it doesn’t hurt my knees.”

The suspension originally was for 80 games, but the MLB Players’ Association contested it.

The Twins gave Pineda a two-year, $10 million contract prior to the 2018 season at a discounted rate for the injury. The investment paid off in 2019, as Pineda became one of their most reliable starters down the stretch as he began to shake the rust off after the long absence from game action. He went 10-4 with a 2.96 ERA and 87 strikeouts in 82 innings in his last 14 starts until the suspension.

Pineda was one of four starters in Minnesota's rotation who became free agents this fall. The Twins re-signed Jake Odorizzi to supplement fellow All-Star Jose Berrios, but there is still a spot or two to likely be filled on the market this winter. The Twins were interested in former New York Mets right-hander Zack Wheeler, who agreed Wednesday to join the Philadelphia Phillies for $118 million over five years.