Jason Grilli knew it as soon as he let it go.

"It was probably the worst pitch I've thrown all season," he said.

Considering how spectacular the veteran reliever has been for the Pittsburgh Pirates this season, he had a small sample size from which to choose.

Minnesota's Josh Willingham turned Grilli's 93 mph mistake into the go-ahead home run as the Twins squeaked out a 2-1 win Wednesday night.

"The second it left my hand, I recoiled and wanted it back," Grilli said.

No such luck for Grilli (1-2), who has been enjoying arguably the best season of his career while working in the back end of Pittsburgh's bullpen. His numbers are of All-Star consideration even on a night he looked more ordinary than extraordinary.

Then again, so were the rest of the Pirates, who lost for just the second time in their last 11 games at PNC Park.

Pittsburgh couldn't solve Minnesota starter Francisco Liriano, who cruised through 6 2-3 innings and when he momentarily faltered, reliever Jared Burton (1-0) picked him up. Glen Perkins worked the ninth for his first save in place of injured closer Matt Capps.

Liriano pitched arguably his best game of the season, giving up one run and four hits. The left-hander struck out six and walked two.

"I feel fine, I feel more consistent with my delivery, throwing more strikes," Liriano said. "I'm hitting my spots. I'm confident in all my pitches."

Pittsburgh's Erik Bedard overcame a shaky start to surrender one run over six innings but was long gone by the time Willingham notched the first homer given up by Grilli since April 17.

The Pirates have surged into contention in the NL Central behind a resurgent offense that began the night third in the National League in runs this month. They looked like the team that slumped through April and May against Liriano, who looked for a night like the pitcher who baffled the Pirates during his only other start at PNC Park six years ago.

Liriano scattered five hits and struck out 11 against no walks on June 16, 2006, a performance that came in the midst of a season in which he went 12-3 and made the All-Star team before blowing out his left elbow at the end of the year.

He has showed only flashes of brilliance in the interim and pitched so badly at the beginning of the season he spent some time in the bullpen in May before returning to the starting rotation on May 30.

"I've been happy with him since he's come back in the rotation," Twins manager Ron Gardenhire said. "I think he's attacked and he's really worked at it and I think he's going to be a big influence on our baseball team. Throwing the ball like that can get us a lot of confidence."

Though Liriano's stuff wasn't electric against the Pirates, it was efficient. He breezed through the first five innings and didn't get a three-ball count on any batter until he intentionally walked Andrew McCutchen with two outs in the sixth. Not bad for a pitcher who was averaging 5.4 walks per nine innings coming in.

Liriano finally tired in the seventh, drilling Pedro Alvarez with one out then giving up a single to Clint Barmes and walking Mike McKenry to load the bases. Gardenhire stayed with him and Liriano escaped major damage — barely — when Denard Span tracked down pinch-hitter Rod Barajas' sinking liner to center field. Span made a spectacular diving catch, turning extra bases into a sacrifice fly.

"He was tracking that ball the whole way whether it was going to get to the ground of not," Gardenhire said. "It was hooking the whole way, too, so that was a hell of a play. He covered a lot of ground."

Bedard did his best to keep pace with Liriano. The left-hander has struggled in June, failing to get out of the fourth inning in two of his three starts this month, including a miserable outing in a 12-6 loss to Baltimore last week in which he gave up seven runs in just 3 1-3 innings.

It looked like more of the same early. Willingham doubled with two outs, Justin Mourneau walked and Willingham came home on a single by Trevor Plouffe. A walk to Brian Dozier followed to load the bases before Bedard got Jamey Carroll to line back to the mound.

"I got two quick outs, I just couldn't get the third one," Bedard said.

Bedard had little trouble over his final five innings but Pittsburgh's offense couldn't pick him up.

NOTES: Twins C Joe Mauer missed his second straight game while nursing a bruised right quad suffered during Sunday's game against Milwaukee. Mauer could have been available to pinch-hit but still has trouble running. ... Pittsburgh manager Clint Hurdle says Major League Baseball told him Hall of Famer Bill Mazeroski could not be in the dugout during games. The Pirates brought in Mazeroski and former outfielder Bill Virdon this week to serve as mentors to the young team. Mazeroski and Virdon watched the game from elsewhere inside PNC Park ... The series wraps up Thursday as Pittsburgh's James McDonald (5-3, 2.32 ERA) faces Liam Hendricks (0-3, 7.83).