PITTSBURGH - For five innings Wednesday, Francisco Liriano was the pitcher the Twins expected him to be this season. His pitches were around the plate, helping him get into favorable counts. He didn't pile up the strikeouts like he used to, but he was as efficient as he's been all season.

His last two innings were like the Liriano who has been hard to watch this year. With men on base, he suddenly can't find the plate, and innings quickly become jams.

Fortunately for the Twins, there was more Functional Frankie than Flustered Frankie, enough for them to pull out a 2-1 victory at PNC Park against a Pirates team that had been 9-1 against lefthanded starters at home.

"I feel more consistent with my delivery," Liriano said. "I feel like I can throw more strikes. I have more confidence in all my pitches."

Given a 1-0 lead in the first inning, Liriano carried it into the seventh, when he loaded the bases and gave up a game-tying sacrifice fly to Rod Barajas -- on a ball on which Denard Span made a splendid running catch.

Josh Willingham won it for the Twins in the eighth with a homer to left, his 14th of the season.

Righthander Jared Burton, who replaced Liriano with two runners on base in the seventh, pitched 11/3 innings and got the victory. Lefthander Glen Perkins, subbing for injured closer Matt Capps, pitched the ninth and picked up his first save of the season and third of his career.

Liriano, since returning to the starting rotation on May 30, is 1-2 with a 2.67 ERA in five starts. In 301/3 innings, he has walked 12 and struck out 35.

His start on Wednesday was the best of the five. He pitched a season-high 62/3 innings, giving up one earned run on six hits and two walks with six strikeouts.

"This is what we saw out of spring training," Twins manager Ron Gardenhire said. "Pounding the strike zone with all of his pitches. A really good fastball in and out. Setting his other pitches up with the fastball.

''And that slider, when they try to cheat for that fastball, he's throwing the slider and changeup."

Of Liriano's 97 pitches, 60 were strikes. Liriano has thrown more strikes since returning to the rotation, and his strike percentage of 61.8 percent on Wednesday was a season high.

Liriano posted a quality start in his last outing on Friday against Milwaukee, but he seemed to be a disaster waiting to happen because he walked four batters and battled through deep counts all night.

Against the Pirates, he took his pitching to another level. Granted, it was against the worst offense in the majors, but he did what a good pitcher should do to a weak lineup.

Gardenhire felt that the heat -- game time temperature was 91 degrees -- factored into Liriano struggling later in the game. But he held things together long enough for Willingham to win it in the eighth.

"When you walk out in the clubhouse, there'll be eight guys out there saying, 'I called that shot,'" Gardenhire said.

"Probably the most obvious call in our clubhouse is, 'Willingham's going to hit a homer,' and they're all taking credit. You'll see a lot of guys with ice on their arms from patting themselves on the back."