Randy Johnson struck out 10 and allowed three hits in 6 1-3 innings and the Arizona Diamondbacks beat the San Diego Padres 3-2 on Sunday.

Justin Upton hit the second-longest home run in Chase Field history and Mark Reynolds also homered for the Diamondbacks, who went 3-4 on their seven-game homestand.

Scott Hairston hit his second leadoff homer of the season for the Padres, who saw their modest two-game winning streak snapped and have lost 15 of 19.

Johnson (5-7) moved into sole possession of 24th place on the career victory list with his 289th win, moving ahead of Tommy John. It was his first victory since May 18.

After surrendering Hairston's home run, Johnson did not allow another hit until Edgar Gonzalez's sixth-inning single. Johnson retired 20 of 23 hitters overall, didn't allow a walk and hit a batter.

The Padres nearly spoiled Johnson's milestone with a ninth-inning rally against Brandon Lyon.

Adrian Gonzalez led off with a single and Kevin Kouzmanoff hit a tailing line drive to right that bounced off the glove of a diving Upton. Gonzalez initially stopped at third but both runners advanced when Upton's throw tipped off the top of both Orlando Hudson and Chad Tracy's gloves, making it 3-2.

But Lyon struck out Chase Headley and retired Khalil Greene and Luis Rodriguez on consecutive grounders to second for his 18th save.

Upton tied the game at 1 in the bottom of the fifth when he hit a towering drive off Josh Banks onto the upper row of the patio fronting a second-deck restaurant in left field, an estimated 484-foot shot.

Stephen Drew added an RBI single in the fifth and Reynolds added his home run, a 424-foot shot off the batters eye above the center field wall, to make it 3-1.

Banks (2-4) allowed the three runs and seven hits over six innings with a walk and two strikeouts in losing his fourth straight start.

Notes:@ Johnson also struck out 10 hitters without a walk May 24 at Atlanta. ... Johnson recorded his 211th game with double-digit strikeouts, just four shy of Nolan Ryan's record of 215. ... Richie Sexson hit the longest home run in Chase Field history, a 503-foot drive off the scoreboard in center field on April 26, 2004. ... Before the game the Diamondbacks placed RHP Juan Cruz on the 15-day disabled list with a strained left oblique muscle. Cruz, 2-0 with a 3.23 ERA in 30 2-3 innings, threw three pitches to Gonzalez in Saturday's 4-2 Padres victory before leaving the game. ... To replace Cruz, Arizona recalled RHP Connor Robertson from Triple-A Tucson. Robertson made his Arizona debut on July 1 and pitched again Thursday before being optioned to Tucson on Friday. ... Hairston's other leadoff home run came June 4 off Ted Lilly of the Chicago Cubs.