Camilo Doval held onto to a precious one-run lead in the eighth Saturday, after the Dodgers threatened for the second inning in a row.
In back-to-back innings late in their game against the Los Angeles Dodgers on Saturday at Oracle Park, Gabe Kapler and the Giants were starring at certain doom.
The vaunted Dodgers loaded the bases in both the seventh and eighth innings, threatening to take the lead and potentially blow the game wide open at either point.
Stay in the game with the latest updates on your beloved Bay Area and California sports teams! Sign up here for our All Access Daily newsletter.
Jarlín García and Camilo Doval had other ideas, helping the Giants hold on for a thrilling, heart-stopping 3-2 win over the NL West-leading Dodgers in front of a raucous crowd, split between both fan bases.
With the Giants leading 2-0 in the top of the seventh, after Zack Littell loaded the bases with no one out, Kapler turned to García and amazingly, he struck out Freddie Freeman and got Trea Turner to ground into an inning-ending double play.
García began the top of the eighth inning but his effectiveness didn't join him. Will Smith singled with one out and an error by Thairo Estrada on a ground ball by Justin Turner put two runners on. Cody Bellinger stepped up and crushed a ground-rule double to left-center, scoring Smith and cutting the Giants' lead to 2-1.
With one out, Kapler called on young reliever Camilo Doval to try to limit the damage. The first batter he faced, Chris Taylor, walked, once again loading the bases.
But just like Garcia before him, Doval dug out of the hole by striking out Gavin Lux and Mookie Betts to end the inning, preserving the lead.
In the bottom of the eighth, the Giants themselves loaded the bases and managed to get the run back after a wild pitch by Craig Kimbrel allowed Joc Pederson to score.
Jose Alvarez pitched the ninth inning and allowed a leadoff solo homer to Freeman. After putting two runners on, he managed to get Bellinger to ground out to end the game, giving the Giants their second straight win over their rival.
The scoring started in the second inning when Estrada took Dodgers starter Clayton Kershaw deep for his fourth homer of the season.
Later in the inning, Luis Gonzalez drove in Crawford with a single to center.
RELATED: Kuiper not surprised by Bart's demotion
San Francisco Giants
Find the latest San Francisco Giants news, highlights, analysis and more with NBC Sports Bay Area and California.
The Giants will go for the three-game sweep Sunday afternoon, with Carlos Rodón taking on Julio Urias in a battle of star left-handed pitchers.