As the Giants and Los Angeles Dodgers counterpunched past midnight into Wednesday morning at AT&T Park, Hector Sanchez's mother sat in a car in the player's parking lot for three hours, eager for the game to end. The backup catcher's daughter was waiting too, for a famous father who needed to drive her to school in the morning.

Sanchez will make that drive on little sleep, but he'll do it as a clubhouse hero after a walk-off single that gave the Giants a 3-2 win at AT&T Park and finally sent the players and coaches home, along with any fans who might have had class in the morning.

"Unbelievable," Sanchez said, shaking his head. "My daughter is still going to school, though."

Sanchez's single off Brandon League brought Brandon Crawford racing home at 12:14 a.m. It was the fourth career walk-off hit for Sanchez, who has just 159 big league games under his belt.

"He's such a confident kid," manager Bruce Bochy said. "He's a little cocky, but yet humble. He wants to be up there in tight situations. This kid is not afraid. He wants to play and be up there with men on base, and he usually winds up having good at-bats."

The Giants didn't have many of them for the previous five hours. They were 2 for 13 with runners on base — including 0 for 5 with the bases loaded — and left 16 runners on base. In the ninth inning, Brandon Belt doubled off Kenley Jansen to bring Angel Pagan home as the tying run -- but Belt was stranded as Pablo Sandoval struck out and Hunter Pence flied out. The Giants left the bases loaded in the 10th, with Pagan popping up and Belt flying out against a Dodgers side that at one point brought outfielder Andre Ethier up to the dirt as a fifth infielder.

Crawford and Sanchez finally ended the drama in the 12th. The shortstop, who had a walk-off homer Sunday, reached on a one-out single. Sanchez had come in on a double-switch that sent Buster Posey to the bench for the night, and he knew struggling Dodgers right-hander Brandon League would try to get him with sinkers.

"I was thinking about going back up the middle of the field," Sanchez said.

His liner glanced off second baseman Justin Turner's glove as Crawford headed home and then turned for Sanchez. As is the tradition, Sanchez took a beating, with Belt jabbing his backside with a few well-placed knees.

"Nobody else was there," Belt said, shrugging. "He fell down. That's what he gets ..."

Sanchez was happy to take another walk-off wallop.

"I was worried about those guys -- they kill you when you get a walk-off," he said. "But those are probably the only punches that don't hurt."

The drama came hours after Tim Lincecum put forth his best effort of the season. Even as his overall numbers plummeted the past two seasons, Lincecum could always summon his old form when the rival Los Angeles Dodgers filled the opposing dugout. Lincecum had a 5.18 ERA in 2012, but it was just 2.63 against the Dodgers. He had a 4.37 ERA last year but a 3.47 mark against the division champions.