MINNEAPOLIS -- The Twins’ first major acquisition following the 2017 season was big right-hander Michael Pineda, who signed a two-year deal worth at least $10 million on Dec. 13. The catch was that Pineda was rehabbing from Tommy John surgery and only expected to pitch one season — this one.

The gambit has so far proved wise.

Pineda continued his upward trend on Saturday, pitching one of his best games of the season in a 7-4 victory over the Texas Rangers in front of 36,969 at Target Field on Saturday afternoon.

Jason Castro drove in three runs, and Byron Buxton added two RBIs as the Twins won the first two games of a three-game set that takes them into the four-day all-star break. Miguel Sano tripled, walked and scored twice, and Marwin Gonzalez came off the bench to hit the team’s 166th homer of the season.

Pineda, however, was the story — if only because his ascent has been, if not unlikely, at least remarkable. He had surgery to repair his right elbow almost in July 2017 was paid $2 million last season just to get healthy. He did, but a planned September start was scuttled because of a knee injury.

“After you have surgery, it’s a long time for the recovery, so you have to work so hard to be a hundred percent and try to help your team,” Pineda said. “The last couple games I’ve pitched really good games and helped my team win the game, so I’m happy for that, you know?”

Pineda (6-4) allowed one run on five hits and a walk and struck out a season-high nine, attributing some of the success to a changeup he began focusing on this season.

“Well, everybody knows I always have good command and throw a lot of strikes, but right now I feel pretty good about my changeup,” he said. “Before in my career, I’m not using a lot of changeups, and right now I’m using more and the changeup is really good, so it’s helping my slider.”

Pineda left with a 5-1 lead before Tyler Duffey gave up three runs in the seventh on two singles, a balk and Willie Calhoun’s two-run home run to right field. Taylor Rogers got the last out of the inning on a grounder to short and stuck around to earn his 12th save. He pitched 2.1 hitless innings with four strikeouts.

Marwin Gonzalez gave the Twins a 6-4 lead in the eighth inning with a solo home run that traveled an estimated 408 feet into the right-field seats, the Twins’ MLB-leading 166th homer of the season. Three batters later, Jason Castro drove in Jonathan Schoop from third with a single to right for the final margin.

In his first seven starts this season, Pineda was 2-3 with a 6.09 earned-run average in 34 innings. Since then, he’s 4-1 with a 3.71 ERA and seven quality starts. The Twins are 7-3 in those games. It’s a far cry from what the Cubs got from Drew Smyly, who signed an almost identical deal with Chicago the day before Pineda signed with Minnesota.

Smyly never pitched for the Cubs and was traded to Texas in a somewhat complicated salary dump deal that allowed the Cubs to pick up a $20 million option on Cole Hamels. The Rangers, who paid Smyly $7 million while avoiding a $6 million buyout on Hamels, released Smyly in June after he went 1-5 with an 8.42 ERA.

Pineda has been the other side of the coin, playing an increasingly large role in the Twins’ ascent to becoming one of the best teams in baseball. When asked if he’s finally 100 percent, he was incredulous.

“Yeah,” he said. “I’m pitching good games, so I’m a hundred percent right now. I want to keep working hard and help my team. Yeah, I’m a hundred percent right now.”