SAN DIEGO -- Last place San Diego made the improbable happen by sweeping NL West-leading Arizona.
The Padres did it when Jody Gerut's go-ahead single capped a two-run rally in the eighth inning for a 5-4 win over the Diamondbacks on Wednesday.
It was Arizona's fourth straight loss and fifth in six games. The Diamondbacks remained three games in front of the second-place Los Angeles Dodgers, who lost 5-4 at Washington.
The Padres faced the Diamondbacks' top three pitchers this week in answering Arizona's home sweep of San Diego last week. The loss also prevented Randy Johnson from gaining his 295th career victory.
"We obviously didn't expect this series with the pitchers we had going," Arizona manager Bob Melvin said. "Don't foresee getting swept with those three pitchers but we have to deal with it and move on."
"At this point, we'll probably be spoilers," Gerut said. "We want to make the other team sweat a little bit. The last thing we want to do is have people come in here and us be pushovers."
San Diego (51-82) has the second-worst record in the NL.
Gerut hit a two-run homer in the ninth inning on Monday night to give San Diego a 4-2 win in a game started by Dan Haren, who is 14-6. San Diego then handed 19-game winner Brandon Webb a 9-2 loss on Tuesday night.
"It's a bit of a frustrating series," Johnson said. "The first day we were here, Haren pitched really well. And today ... for them to win both of those games and sweep us, the off day might be coming at the right time for us."
Arizona is off on Thursday before opening a three-game set at home against the Dodgers.
"You could sense we got a little bit too tight," Melvin said. "We've been through several periods like that this year where we had to respond and we have. We've had a lot of games where we have been heartbroken this year.
"We've had issues earlier with closing out games. It's been a problem for us all year but we've always responded."
Arizona had 29 games left, six against the Dodgers.
"Now is not the time to panic," Diamondbacks center fielder Chris Young said. "We are still in first, we still control what happens. We'll be OK. No one in here is worrying."
San Diego's comeback ruined Johnson's second attempt at No. 295 despite seven solid innings. Johnson, who had two hits and an RBI, allowed three runs and five hits with nine strikeouts. He is 6-2 with a 2.16 ERA in his past 10 starts.
Johnson was sharp through six innings, giving up just two hits and not allowing a baserunner past second base. But he allowed three runs in the seventh, including rookie Nick Hundley's two-run homer.
"Randy was very good," Padres manager Bud Black said. "As far as pitching and changing speeds, that's as good as I have seen him."
San Diego scored two runs off Qualls, who started the eighth. Headley tied the game with a single that scored Giles, who singled as a pinch-hitter and was sacrificed to second.
The Diamondbacks broke a scoreless tie in the sixth with four runs that knocked Cha Seung Baek from the game.
Chad Tracy and Adam Dunn had one-out singles in the sixth. Mark Reynolds hit a sacrifice fly to knock out Baek. Miguel Montero hit an RBI triple off Clay Hensley and Young followed with a double. After an intentional walk, Johnson singled to left to drive in one run for a 4-0 lead.
The Padres broke through against Johnson in the seventh after Gerut's one-out triple. He scored on an infield single by Edgar Gonzalez. Hundley followed with a two-run homer, his third.
"I'm not going to say it was a bad pitch," Johnson said of the slider that Hundley hit. "It was down. Obviously, he hit it. But the (single) he had in the third, was the same pitch down."
San Diego swept its first series since taking four straight against the New York Mets from June 5-8.
Game notes Johnson is trying to become the 24th pitcher in major league history with 300 victories. ... Baek is 0-7 with an 5.94 ERA at home. ... San Diego first-round draft pick Allan Dykstra got his first professional hit, a three-run double, for Single-A Lake Elsinore, which played at Petco Park against Inland Empire after the Diamondbacks-Padres game.