They blew a two-run lead in the eighth on home runs by Jason Giambi and Bobby Crosby off the previously untouchable Ramon Troncoso to turn a the two-run lead into a two-run deficit, yet they managed to quickly score two runs to the tie the game.
And in the 10th, they managed to scratch across the winning run on a Matt Kemp single after a disputed call at first base gave the Dodgers two outs instead of one.
But it was just another typical close win for the Dodgers, whose 5-4 win over the A's in 10 innings on Tuesday improved their record to 12-1 at home in one-run games and 6-1 in extra innings.
"It was a great ending," Dodgers manager Joe Torre said. "It was a crazy game, obviously. We had shutouts going on both sides and all of sudden we break through. And then Troncoso makes a couple of bad pitches, but we got away with it."
The Dodgers got away with it by showing the late-inning resolve that has them atop Major League Baseball with the best record.
It started in the 10th when Orlando Hudson led off with a single off reliever Brad Ziegler before Casey Blake reached on an error.
Then James Loney grounded out into a double play in which he was originally ruled safe by first-base umpire Adrian Johnson before it was reversed by home-plate umpire Ted Barrett, who ruled that Loney was tagged out by Giambi before reaching first.
But the play didn't matter as Kemp gave the Dodgers their Major League-leading eighth walk-off win with a single into right field to score Hudson from third, exciting the crowd of 42,535.
"I was just looking for a pitch to hit," Kemp said. "He started me off with a fastball and then threw another one. He left it up, and I took it the other way."
The win took Troncoso off the hook as the right-hander had a rare off night. Troncoso, who had tossed 13 1/3 scoreless innings entering the game, allowed a single to Kurt Suzuki to open the eighth before walking Matt Holliday with one out. Then Giambi deposited Troncoso's 1-2 slider into the right-field seats to give the A's a one-run lead. Just two batters later, Crosby hit another home run to give Oakland a 4-2 lead.
But the Dodgers struck quickly in the eighth with two runs of their own when Blake drove home Rafael Furcal, who doubled to open the inning. Andre Ethier plated a run on a fielder's choice when Kemp slid hard into second to break up the double play.
"That was huge to come back quickly like that," Torre said. "It kept them from settling in."
But Troncoso's rough outing spoiled a solid start from left-hander Clayton Kershaw, who tossed 5 2/3 scoreless innings and struck out eight. It was a marked improvement after he lasted just 2 2/3 innings in his previous outing.
"Kershaw was really good," Torre said. "He did a great job. It was a big game after that last outing for sure."
It was Kershaw's counterpart, A's left-hander Dallas Braden, who was perfect through 4 2/3 innings, however. But Braden's performance only motivated Kershaw to keep the A's scoreless.
"You try and match him when a guy's pitching like that," Kershaw said. "You don't want to put your team in a hole, so in that sense, you're a little more careful. But other than that it's not too much different."
Kemp broke up the perfect game in the fifth inning with two outs with a double in left-center just past the reach of center fielder Rajai Davis. But the Dodgers didn't get on the board until the sixth inning when Blake hit a two-out double to left-center to score Hudson from first base. Loney then followed with an RBI double to right-center to give the Dodgers their second run of the game.
Dodgers reliever Guillermo Mota pitched a perfect 10th inning to pick up his third win and extended his scoreless innings streak to 11 2/3 innings in the process.
With the win, Torre also reached a milestone as he tied Sparky Anderson for fifth on the all-time win list for managers with 2,194 career victories.
"It means you've been around a long time, but it's a pretty good neighborhood," Torre said of the milestone. "Sparky Anderson, I've had respect for him since the day I met him, and before that, I watched him manage."
Tuesday's win was also the Dodgers' 13th victory this season in their last at-bat and their 18th come-from-behind win.
"It always seems like we get the big hits," Kershaw said. "We seem to find a way to win one way or another, so it's fun to be a part of."