SAN DIEGO -- The San Diego Padres defeated the Pittsburgh Pirates 3-2 Wednesday afternoon on one hit while getting only one ball out of the infield.

The Padres' only hit was shortstop Everth Cabrera's bunt single in the Padres' two-run first inning.

Their longest ball before catcher Rene Rivera's fly to center to end the eighth was left fielder Carlos Quentin's sacrifice fly to second baseman Josh Harrison in short right in the first.

San Diego took advantage of the wildness of Pirates left-handed starter Francisco Liriano, who walked six hitters (one intentionally) and hit a batter, to salvage the last game of a three-game series.

The win was the Padres' third ever while getting only one hit. The Padres (27-33) snapped a three-game losing streak and ended a three-game winning streak by Pittsburgh (28-31).

Right-hander Ian Kennedy became the first Padre to win three straight decisions this season while right-handed closer Huston Street picked up his 18th save in as many chances.

Liriano (1-6) allowed only one hit, but he walked six and Pittsburgh trailed 3-1 when he departed the game after five innings.

Right fielder Chris Denorfia opened the Padres' first by drawing the first walk issued by Liriano.

After Denorfia stole second, Cabrera pushed a bunt toward first that stopped between Liriano and Ike Davis as the pitcher and first baseman looked at one another.

Denorfia scored on Quentin's sacrifice fly to right. Cabrera moved to second when Liriano hit third baseman Chase Headley with a pitch just above the left knee.

With runners on first and second and one out, first baseman Tommy Medica hit a topper back to the mound. Liriano got the force at second, but the relay by Harrison bounced into the stands, allowing Cabrera to score the inning's second run.

Center fielder Andrew McCutchen put the Pirates on the board with a home run to left off Kennedy to open the fourth.

The Padres regained their two-run lead in the fourth on four Liriano walks, including three straight with two outs. With a runner on second and two out, Liriano intentionally walked second baseman Jace Peterson to pitch to Kennedy. Liriano then walked Kennedy and Denorfia to force in the run.

Harrison's two-out, RBI double in the fifth again reduced the Padres' lead to a run.

Liriano's final line was three runs (two earned) on one hit and six walks and a hit batter against seven strikeouts in five innings.

Kennedy allowed two runs on five hits and a walk, with seven strikeouts, in six innings.

NOTES: OF Gregory Polanco, 22, could join the Pirates on Friday for the start of a homestand. Polanco is hitting .351 with 16 doubles, five triples, six homers, 47 RBIs and 42 runs for Triple-A Indianapolis. ... The Padres returned RHP Jesse Hahn, who made his major league debut Tuesday night, to Double-A San Antonio and recalled INF Jace Peterson from Triple-A El Paso. Peterson was hitting .330 with nine doubles, three triples, two homers and 19 RBIs in 27 games for the Chihuahuas. ... RHP Andrew Cashner will come off the disabled list in time to start Saturday's game against the Washington Nationals, the Padres announced.