SAN DIEGO (AP) — Eric Hosmer’s two-run, opposite-field home run off Zack Greinke highlighted the three-run sixth inning that carried the San Diego Padres to a 3-2 victory against the Arizona Diamondbacks on Tuesday night.

Greinke (6-2), who recorded his 2,500th career strikeout in the fourth, was working on a one-hit shutout when he ran into trouble in the sixth. Ian Kinsler singled with one out, advanced on Franmil Reyes’ groundout and scored on Manny Machado’s single. Hosmer then drove Greinke’s next pitch to left field to give the Padres the lead. It was Hosmer’s seventh.

The Padres won their second straight to pop back above .500. The Diamondbacks lost their fourth straight.

Left-hander Matt Strahm (2-3) allowed two solo homers among his four hits in six innings. He struck out two and walked none.

Kirby Yates struck out the side in the ninth for his 19th save.

Greinke allowed three runs and four hits in seven innings, struck out five and walked one. He was trying for his third win against the Padres this season. He beat them 8-5 at Petco Park on April 2, when he struck out 10 and hit two home runs.

He got Franmil Reyes swinging leading off the fourth for career strikeout 2,500.

The Diamondbacks took a 2-0 lead on long balls. Eduardo Escobar homered with one out in the fourth, his 11th, and John Ryan Murphy connected with two outs in the fifth, his fourth.

TRAINER’S ROOM

Diamondbacks: Placed INF Wilmer Flores on the 10-day injured list with a bruised right foot, retroactive to Monday, and recalled Ildemaro Vargas from the Triple-A Reno.

UP NEXT

Diamondbacks: RHP Merrill Kelly (4-4, 4.21) is scheduled to start the series finale Wednesday afternoon. He won his MLB debut at Petco Park on April 1.