SAN FRANCISCO(AP) Tempers flared. Emotions ran wild. Benches cleared and managers were tossed.
Everything one would expect from a Dodgers-Giants game, especially this year with both clubs in the playoff chase.
Juan Uribe hit a game-ending two-run homer with one out in the 10th inning and San Francisco avoided a three-game sweep by archrival Los Angeles with a 4-2 victory Wednesday.
Brian Wilson (4-5) pitched 1 1-3 innings with four strikeouts for the win on a crazy day in which the benches cleared and both Giants manager Bruce Bochy and bench coach - and acting manager - Ron Wotus were ejected in separate arguments.
''I was watching the game here, there, everywhere. I got a good workout today,'' Bochy said of what he did after his second-inning ejection. ''It was an intense game, an important game and a lot happened. ... I was worried about running out of managers today.''
Travis Ishikawa drew a leadoff walk in the 10th from Guillermo Mota (3-4), and Randy Winn flied out before Uribe connected for his fifth homer.
Tim Lincecum pitched into the ninth and had only allowed two hits before Rafael Furcal beat out an infield single. Andre Ethier hit a tying RBI single two batters later.
''The people got what they wanted to see,'' Dodgers manager Joe Torre said. ''Lincecum was amazing, as he always is. Just two ballclubs fighting.''
The Giants pulled within 6 1/2 games of the first-place Dodgers in the NL West, but missed several key opportunities in this one and stranded 12 baserunners. Uribe left seven runners on before his home run.
San Francisco's Pablo Sandoval - at the center of a fifth-inning dustup - doubled with one out in the ninth but stood for several moments before running, thinking his ball was a home run. Bengie Molina was intentionally walked, then pinch-hitter Aaron Rowand grounded into an inning-ending double play.
Furcal's single with one out in the ninth caused Wotus to run out and argue before he was tossed. Third base coach Tim Flannery took over managerial duties and still did his job on the field.
Furcal also had an RBI groundout in the sixth for the Dodgers' first run.
Los Angeles swept the Giants at Dodger Stadium earlier this season but missed a chance to sweep at San Francisco for the first time since July 13-15, 2007.
Los Angeles concluded a stretch of 20 games in 20 days, dating to July 24 against Florida. The Dodgers have a day off Thursday before a weekend series at Arizona.
San Francisco, meanwhile, leaves for a season-high, 11-game road trip with some momentum from this crazy game - witnessed by a sellout crowd of 43,300.
The benches cleared in the bottom of the fifth inning but no punches were thrown and there were no ejections.
Sandoval claimed he was hit near his left elbow on an inside pitch from James McDonald , gesturing and pointing at the pitcher. Dodgers catcher Russell Martin then had words with Sandoval, and Edgar Renteria raced out of San Francisco's dugout as both benches emptied. Moments earlier, Eugenio Velez came hard into home and collided with Martin as the Giants took a 1-0 lead.
''Just the emotions flying. He said some words to James McDonald , I said some words back to him, benches cleared,'' Martin said. ''No punches thrown or anything like that. Just a verbal confrontation.''
Sandoval later walked.
''They said it hit the bat. I tried to show them the mark but they wouldn't go for it,'' Sandoval said. ''I was reacting to getting hit. I don't want to do something like (charging, yelling at the pitcher or catcher) that. I want to stay in the game. I didn't know what was going on until I reached first base. I wanted to get to a place where I could calm down.''
Bochy was already long gone.
He was tossed by first base umpire Gary Darling for arguing the Giants' unsuccessful pickoff attempt of Manny Ramirez . It marked the fourth time Bochy has been ejected this season and the second time this series after getting tossed Monday night.
Jeff Weaver , Los Angeles' reliable swingman, came out of the bullpen to start. He replaced Chad Billingsley , who was scratched from this outing Monday because of a mild left hamstring strain. Weaver went three scoreless innings, allowing two hits with three strikeouts and two walks.
NOTES: Bochy has 45 career ejections. ... Los Angeles 2B Orlando Hudson missed his second straight start with a strained left groin, but pinch-hit. ... 2B Freddy Sanchez and SS Juan Uribe both returned to the Giants' infield after missing Tuesday's game. Sanchez had tweaked his left shoulder and Uribe had a hurt hamstring. ... The Giants placed INF Rich Aurilia on the DL with an ankle injury to make room for OF Nate Schierholtz (strained hip), who came off the DL.
Copyright 2015 Associated Press. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.