SAN DIEGO -- Not even a ninth-inning collapse could stop the Los Angeles Dodgers.
"We had to win," Los Angeles manager Joe Torre said. "I guess this is the product of the fact that we have played so many close games. Even though we were emotionally drained after that ninth inning, we go out there and worked at it."
The Dodgers have the majors' best winning percentage in one-run games at .692 (18-8). Los Angeles (52-30) also has the best record in the big leagues.
"I'm just thankful we got the win," said Dodgers starter Chad Billingsley, who was named to his first All-Star game Sunday. "That's all that matters. We could have really gotten down on ourselves."
Loney hit his sixth homer of the season into the right-field seats off Edward Mujica (2-4) to help the Dodgers win on a day when Manny Ramirez didn't start for the first time since he returned from a 50-game drug suspension on Friday. Manager Joe Torre said he wanted Ramirez to rest his legs after being out so long.
"I was looking fastball and I got it," Loney said. "I'm not thinking about hitting a home run, but I am thinking about driving the ball."
Said Mujica: "I tried to throw it more toward the middle, but the ball moved inside and he put a good swing on it."
Jeff Weaver (5-2) pitched three hitless innings for the win. He intentionally walked Adrian Gonzalez with one out and none on in the 13th inning to bring up pitcher Kevin Correia, who sacrificed him over to second. The Padres had no position players left so they brought him in to bunt.
Weaver struck out rookie Kyle Blanks to end the game.
"Weaver did a great job," Torre said. "He's been so good for us. There's a certain calmness when he comes in the game."
Los Angeles pounded out 18 hits and took a 6-0 lead in the fifth. But the Dodgers tied a season high by stranding 14 runners, including twice leaving the bases loaded.
The rally ruined a masterful game by Billingsley, who carried a two-hitter into the ninth inning.
Billingsley was three outs away from his third career complete game and first of the season when Chase Headley led off the ninth with a home run and Tony Gwynn Jr. doubled. Broxton replaced Billingsley and issued a one-out walk to Scott Hairston.
He gave up an RBI single to pinch-hitter Will Venable with two outs before he walked Edgar Gonzalez to load the bases. Broxton then walked Alfonzo for another run that cut the lead to 6-4. Broxton ran the count full before Cabrera chopped a ball up the middle to score two runs.
As Alfonzo went from first to third on the hit, he overslid the bag and was tagged for the final out.
"I just didn't have it," Broxton said. "I can't afford to give up base on balls."
Billingsley dominated the Padres through eight innings. Billingsley, who struck out five and did not walk a batter, also hit his first major league homer in 154 at-bats, a solo shot off Josh Banks in the fifth and had two hits.
Billingsley was charged with three runs on four hits, including a solo homer to Kevin Kouzmanoff in the fifth.
San Diego's comeback was similar to a 6-5 win over the Dodgers on June 7, 2007, when the Padres scored five runs in the bottom of the ninth off Broxton for the win. ... Billingsley's homer was the first by an opposing pitcher against San Diego since Andy Pettite hit one against Chan Ho Park on Aug. 11, 2006, at Houston. ... Kouzmanoff had gone hitless in his previous 21 at-bats before he homered into the second deck in left field.