It took a couple of tries, but near-perfect was finally good enough for the Twins.

One day after Sonny Gray retired the first 16 Pirates he faced but then stumbled into a loss, Dallas Keuchel recorded 19 consecutive outs Sunday before giving up a hit. This time, though, the Twins finished off the game, a 2-0 shutout at Target Field, and the series, beating Pittsburgh two out of three.

The Twins' fifth victory in their past seven games, combined with the Guardians' loss to the Tigers, increased Minnesota's AL Central lead to six games.

"It was an all-around pretty amazing day," Twins manager Rocco Baldelli said.

No kidding. If Gray's shot at perfection was the random consequence of ne of the American League's best pitchers facing the National League's least-threatening team, Keuchel's weak-contact masterpiece was nothing short of stunning.

The Twins' midseason lottery ticket, his career seemingly over after being released by three teams last year, owned a 9.45 ERA after his first two starts with the Twins and had given up more than two hits per inning. His 88-mph-at-best repertoire hadn't recorded a single strikeout.

Keuchel seemed to be fighting for his job, not history.

Yet not only did the former Cy Young Award winner whiff three hitters Sunday, he used a remarkable mix of sinkers, cutters and changeups to induce weak grounder after routine fly ball after infield popup, three up and three down for six straight innings. His pitches seemed to draw more disbelief from the Pirates than aggression: Though they swung and missed only six times, they took 21 pitches that plate umpire Laz Diaz judged to be strikes.

"To do that, and to corral the strike zone again, that was probably the most fun I've had in a very long time," the 35-year-old lefthander said. "I'd like to keep it up. I'll take any pointers to keep it going next start."

Here's one: With the crowd thinking no-hitter, don't leave a 3-1 sinker hanging up and away against Bryan Reynolds. The Pirates left fielder lofted a fly ball to right field that kept on carrying, finally striking the wall about 2 feet out of Matt Wallner's reach.

"A foot shorter, I think I have it," the rookie right fielder said of Reynolds' perfection-spoiling double, which elicited audible disappointment from the announced crowd of 25,987. "I definitely wanted to go get it. Normally, I'm not going to go that close to the wall, but that one, I wanted the opportunity to jump."

Baldelli immediately hopped out of the dugout and removed Keuchel, who accepted congratulations from his teammates before strolling to the dugout, tipping his cap in response to a long, loud ovation.

The applause was wonderful, Keuchel said. The vindication, the confirmation that he still has the ability to retire big league hitters, was even better.

"It's kind of a testament to the work I put in and the confidence I have. As long as I'm around the zone and making sure I'm mixing pitches, I can be as good as anyone out there," Keuchel said. "This is why I came back. This was a good feeling."

Griffin Jax prevented Reynolds from spoiling that feeling and the shutout by striking out Andrew McCutchen, Saturday's hero for the Pirates, and Ke'Bryan Hayes with down-and-away sweepers.

Caleb Thielbar and Jhoan Duran each pitched a scoreless inning, with Duran giving up a single to Reynolds, to finish off the Twins' third two-hitter and 10th shutout of the season.

Edouard Julien and Donovan Solano provided both runs for the Twins. Solano singled in the fourth inning and scored on Julien's sacrifice fly; he smacked a leadoff double two innings later, and Julien doubled him home.

Keuchel did the rest.

"He's done everything we've asked him to do. Dallas has thrown the ball really well. He's put himself in a nice position through hard work and a lot of perseverance," Baldelli said. "You get rewarded by watching a guy throw a gem just like that."