Baseball is a difficult game to figure out at times.

By all appearances the Milwaukee Brewers were overmatched when they took the field Wednesday night. They had lost five in a row were fielding yet another watered-down lineup and the first-place Pittsburgh Pirates had ace Francisco Liriano on the mound.

Defying those odds the Brewers avoided a winless home stand by scoring five times off Liriano in the third inning and going on to a 9-3 victory at Miller Park.

With the loss the Pirates had to wait to clinch their first winning season since 1992.

Liriano entered the game with a 15-6 record and 2.57 earned run average earning notice as one of the biggest surprises in the majors. After a 1-2-3 first inning however he never regained his footing surrendering seven hits two walks two wild pitches and seven runs while recording only nine outs.

"It's hard to figure out" said Brewers manager Ron Roenicke. "Liriano is having a great year. We saw him once earlier this year and didn't do much off him (two runs in 112/3 innings in two losses).

"I don't know if his location was off or we were just hitting good pitches but it was sure nice to see. I was thinking going into the game if Wily (Peralta) could hold them down enough maybe if we scored two or three (runs) we could get it."

Peralta had his issues in the early going as well but managed to limit the damage. He made it through six innings allowing nine hits and three runs to win for the first time since Aug. 6.

Peralta (10-14) was fortunate to hold the Pirates to two runs over the first three innings. He left the bases loaded in the second inning after issuing a five-pitch walk to Liriano with two down.

With a run in runners on the corners and one down in the third Peralta struck out NL home run leader Pedro Alvarez and retired John Buck on a chopper to third. Those escape acts allowed the Brewers to take a 2-2 tie into the bottom of the third their runs scoring on a two-run blast to left-center by Khris Davis in the second.

"When you get out of those jams like that and keep your team in the game I was finally able to get my rhythm" said Peralta. "I was fighting myself. The last three innings I started feeling better and commanding my pitches better."