PITTSBURGH -- Pedro Alvarez and Neil Walker picked the ideal time to break out of their slumps.
Both hit home runs during a five-run fourth inning to back a dominant Gerrit Cole as the Pittsburgh Pirates whipped the San Diego Padres 10-1 on Thursday afternoon to avoid being swept in the four-game series.
The Pirates, who had been held to four runs in their three losses in the series, entered the day two games out of first place in the National League Central behind the St. Louis Cardinals, who played at the Colorado Rockies. They moved one game ahead of the idle Cincinnati Reds in the division and wild card races.
Alvarez was hitless in his previous 18 at-bats when he hit a solo shot, his 34th of the season, to center field with one out in the fourth to put the Pirates ahead 2-1.
Following a two-run double by Jose Tabata, Walker belted a two-run homer, his 11th, to right field that increased the lead to 6-1. Walker was on a 3-for-38 skid.
That was more than enough support for Cole, who struck out 12 in six innings. The rookie right-hander allowed only one run on four hits and three walks.
It was the most strikeouts by a Pirates rookie pitcher since Jose DeLeon fanned 13 Reds on Aug. 20, 1983.
Cole won his third straight start and ran his streak of quality starts to seven. He has allowed two runs or fewer in six of those seven starts and is 3-0 with a 1.38 ERA in four September starts.
Walker finished 4-for-5 with three RBI. Tabata had two hits and three RBI while Justin Morneau, Tony Sanchez and Jordy Mercer added two hits each and Alvarez drove in two runs.
The Padres lost for just the fifth time in their last 16 games as Ian Kennedy (6-10) was rocked for six runs and eight hits in 3 2/3 innings, ending his streak of five consecutive starts without a loss. Kennedy is 1-6 with a 5.64 ERA in 17 road starts this season.
Chris Denorfia had two hits for the Padres and scored their lone run in the first inning when he doubled and scored on Tommy Medica's single. San Diego had won 14 of its last 15 games in Pittsburgh.
The Padres bullpen's streak of 15 consecutive innings ended in the seventh inning when the Pirates added three runs in the seventh and one in the eight off Anthony Bass to make it 10-1.
Pinch-hitter Garrett Jones and Walker hit RBI singles in the seventh and another run scored on third baseman Chase Headley's throwing error. Alvarez knocked in the final run on a ground out.
The Pirates tied it 1-1 in the bottom of the first on a run-scoring ground out by Andrew McCutchen.
NOTES: Pittsburgh LF Starling Marte missed the game after his wife went into labor Thursday morning with the couple's first child. ... Pirates C Russell Martin, who is 4-for-40 (.100) in September, was rested for a second straight game because manager Clint Hurdle wants him to start in all three games of the series with Cincinnati that begins Friday night at PNC Park. ... San Diego RF Kyle Blanks did not start for a second straight game because of illness. ... Headley's six-game hitting streak ended as he went 0-for-4. ... Pittsburgh LHP Francisco Liriano (16-7, 2.29 ERA) will start Friday night against Reds RHP Mat Latos (14-6, 3.14). ... The Padres begin a three-game home series with the Los Angeles Dodgers on Friday night as LHP Robbie Erlin (2-3, 5.18) is scheduled to face RHP Edinson Volquez (9-11, 5.94). Volquez was released by San Diego last month.