Updated

MIAMI (AP) — Aubrey Huff hit a two-run single to break a tie in the 12th inning Tuesday night, and the San Francisco Giants earned a seesaw victory over the Florida Marlins 9-6.

The Giants' Aaron Rowand hit a two-out solo homer in the ninth against Leo Nunez to tie the game. Dan Uggla's three-run homer with two out in the eighth off Sergio Romo gave the Marlins a 6-5 lead.

Unbeaten Giants ace Tim Lincecum had 13 strikeouts in seven innings and left with a 5-3 lead, but he was denied his fifth win of the season when Florida rallied.

Lincecum was up 3-0 before Hanley Ramirez hit a three-run homer in the sixth. Lincecum's ERA soared to 1.70, but aside from the homer he was in top form, allowing only five hits and one walk.