PHOENIX -- Andrew Cashner set aside nearly five months of struggles Wednesday night.
The result was an effective outing that was backed by Matt Kemp's three-run homer to help the San Diego Padres beat the Arizona Diamondbacks 4-3.
"Cashner was great; player of the game for me," manager Pat Murphy said. "He just attacked a very good offensive team ... with 75 percent (of his pitches) or more were fastballs. Hopefully, he learned something he can take with him going forward, that he doesn't need to go deep in counts. His fastball is that good."
More from FoxSports
Cashner (6-15) allowed seven hits and three runs, striking out six and walking two, in seven innings. He had lost 13 of his previous 17 decisions since April 24.
"I haven't really gone deep into games lately," Cashner said. "It was big to go deep. I commanded my fastball a lot better. I kept it down in the zone. I kept them off balance as far as inside and outside of the plate."
Trailing 2-1 in the fifth inning, Wil Myers walked and then Yangervis Solarte singled. Kemp followed with a line drive to right that barely cleared the fence to give the Padres a 4-2 lead and chase Robbie Ray (4-12) from the game.
Kemp hit a fastball on a 2-2 count. He knew he'd hit the ball well, but wasn't sure he'd knocked it out.
"The ball travels well here," Kemp said. "Good thing we were playing here."
Kemp has 22 homers and 97 RBIs, most for a Padres' outfielder since Greg Vaughn had 119 in 1998.
Jarrod Saltalamacchia hit a solo homer off Cashner in the sixth to cut the Padres' lead to 4-3.
Craig Kimbrell got the final four outs for his 37th save. He also got his first career at-bat in the eighth, striking out. Kimbrell, who hadn't pitched in a week, had joked earlier in the day that he might get an extended stint on the mound and that he might actually step in the batter's box.
Then, "It actually happened," Kimbrell said. "It was fun."
Murphy said he let Kimbrell hit because he was reluctant to do a double-switch and remove any of his starters, for both offensive and defensive reasons.
A.J. Pollock had three hits, including a double. David Peralta extended his hitting streak to 13 with a double in the fourth.
The Diamondbacks loaded the bases in the fourth on Peralta's double and Cashner's walks to Jake Lamb and Brandon Drury. Then Chris Owings lined a two-run single to right to give Arizona a 2-1 lead.
The Padres took a 1-0 lead when Cory Spangenberg singled home Brett Wallace, who had doubled, in the fourth.
Padres: RHP Ian Kennedy (8-14, 4.28 ERA) is set to start Friday night at Colorado. He lost his last start, an 8-0 Padres' loss Saturday at San Francisco.
Diamondbacks: LHP Rubby De La Rosa (12-8, 4.75) will make his 30th start of the season Friday night at San Francisco. He has a 2.20 ERA in three career outings at the Giants.