PHOENIX -- Jeff Karstens, in less than two weeks with the Pirates, nearly completed a task that no Pittsburgh pitcher in the franchise's storied 122 years had accomplished before.

Karstens -- yes, previously known simply as being one of four players the Pirates acquired from the Yankees in the Xavier Nady/Damaso Marte trade -- came within four outs of pitching baseball's first perfect game since 2004. It also would have been the first in Pirates history.

D-backs outfielder Chris Young broke up the perfect game and the no-hitter with two outs in the eighth. But that would be one of only two eventual blemishes of the afternoon for Karstens, as he carried the Pirates to a 2-0 win over Arizona at Chase Field with his two-hit shutout.

"It was a great win and an unbelievable performance," third baseman Chris Gomez said afterward. "You can't downplay how great of a performance it was for him, just because he didn't get a perfect game."

Outfielder Jason Michaels simply shook his head.

"Gosh," Michaels started. "He threw a great game."

Any lingering grumbles about the Pirates not earning a satisfactory return for Nady and Marte likely halted after this one.

Karstens wasn't necessarily the anchor of that trade with the Yankees -- that distinction belonged to Double-A outfielder Jose Tabata. But piggybacking Wednesday's performance with his Pirates debut on Friday, Karstens has given the Pirates reason to believe he could well be a fixture in the rotation for years.

What finished as a 113-pitch shutout, the first of his brief Major League career, didn't start out with the type of dominance that screams perfection. Of the three outs Karstens recorded in the first, two were caught just shy of the wall. The third was a sharp grounder corralled on a nice snag by second baseman Freddy Sanchez.

"After the first inning, I thought, 'It's going to be a long day,'" Karstens said. "They hit all of those balls hard. Sometimes it's better to be lucky than good."

From there, though, he got good.

A few other balls were hit on the nose, but with the spacious outfield at Chase Field, each was caught. That included one that Michaels grabbed just in front of the 413-foot placard in center field.

And in the meantime, Karstens kept throwing strikes.

"I think he might have thrown five balls over the middle of the plate," commented Michaels.

Karstens also mixed more fastballs into his repertoire this time around after relying heavily on his offspeed against the Cubs, a fastball-thriving team, on Friday.

It noticeably threw the Arizona hitters off.

"We had some Minor League stuff on him, but he pitched a little bit differently against the Cubs than he did in the Minor Leagues," D-backs manager Bob Melvin said. "He mixed it up and threw us a bunch of fastballs early on, and we're a pretty good fastball-hitting team."

But the D-backs were being sent down in order frame after frame. As they did, Karstens' demeanor on the mound never changed.

"I've always been taught never to give in," he said. "Don't show any emotion out there. If you do that, they feed off of that."

And he ignored that old superstition about not talking while on the bench in between innings.

"He seemed normal," Gomez said. "He was just talking, not about that obviously, but just about whatever."

As Karstens pushed into the late innings, he also did so with the lead. Fittingly, it was Karstens' mound opponent on Wednesday, Randy Johnson, who was the last Major League pitcher to throw a perfect game. Johnson did so back on May 18, 2004, against the Braves.

"Just tip your hat to Jeff, he pitched an outstanding ballgame," Johnson said. "There's nothing you can take away from that the guy almost pitched a perfect game, so nothing to be ashamed about."

Johnson came into the game with a scoreless-innings streak of 21. He'd toss three more scoreless innings before serving up a solo homer to Sanchez in the fourth.

The Pirates would add their second run off Johnson in the eighth, after Karstens collected his second hit of the game. His single in the third was his first Major League hit. Gomez followed Karstens' eighth-inning hit with a single, before Doug Mientkiewicz drove Karstens in with an RBI double.

Karsten's eighth-inning hit and circle around the bases, which the right-hander admitted left him a little tired, however, may have cost him the chance to go into the ninth with the perfect game still intact.

After he opened the eighth with two quick outs, Young came to the plate with Gomez playing at the normal spot. Had it been a one-run game, the no-doubles defense would likely have been in order, meaning that Gomez would have been closer to the line.

Young hit a 1-1 slider -- a pitch Karstens jokingly referred to as a "cement mixer" afterward -- right down that third-base line, out of the reach of Gomez.

Karstens' reaction?

"It was a quick head jerk," he said. "Then I thought, 'Two outs. Let's get another one.'"

He did, getting Alex Romero to ground out on the next pitch.

Karstens would have one more test, though, in the ninth. He issued a leadoff walk, which brought catcher Raul Chavez to the mound.

"He got nervous the last inning," Chavez said. "He was getting real tired."

Karstens dug in, though, and induced a double play that he started on a grounder up the middle. Had he not made the play, Karstens' afternoon could have been over.

"You don't want to get him in a situation where it could possibly get interesting for him," said manager John Russell, who caught one of Nolan Ryan's no-hitters. "He made a great pitch. It's a good thing he didn't panic on that play. He set his feet and made a great throw."

Karstens allowed one more single before getting Orlando Hudson to ground out to end the game and seal the lone Pirates win of the series. Karstens has picked up both of the wins the Pirates have six games into the road trip.

"This game has a lot of ups and downs," Karstens said. "Right now I'll take the ups. I'm just going to have fun with this, have fun on the ride to Philadelphia with the team, then go from there."

And needless to say, after this one, his teammates are anxious to see where he goes.