Stanford spent 85 minutes alternately turning back No. 1 California's best chances and delivering blows of its own but a penalty in the 86th minute cruelly sent the Cardinal to an undeserved 1-0 loss in Berkeley.
Cardinal defender Matt Taylor lunged to send a California long ball out of the path of a Golden Bear attacker just inside the left edge of the box, but when both men went down the referee pointed to the spot, sending the Stanford bench into a frenzy.
After the appeals of Cardinal captain JJ Koval and goalkeeper Drew Hutchins went unanswered, Hutchins still gave the Cardinal a chance by stoning Steve Birnbaum's penalty attempt but was unlucky to have the rebound bounce straight back to Birnbaum, who poked home what ended up being the winner.
"I am incredibly proud of our guys and it was an enthralling game of soccer," Stanford coaxch Jeremy Gunn said. "We had some good chances and called their keeper into action a few times. I just truly feel for our players, we put everything into it and we didn't deserve the final outcome. Full credit to Cal, they're an awesome soccer team, they played very well."
The shot totals were nearly even between the two teams, with California holding a slight 15-14 edge, while Hutchins made seven saves to six for his California counterpart Justin Taillole.
Playing against its fifth top-10 opponent of the season the Cardinal came into Berkeley and withstood the best chances of the top-ranked Golden Bears over the opening 45 minutes.
The Golden Bears won a couple of corner kicks within the opening five minutes, which went to naught thanks to the strong clearances of the Cardinal defense, and Stanford nearly nicked an early goal in the eighth minute when Jordan Morris latched onto a cross which was saved by Taillole.
Hutchins was called into action for the first time early in the ninth minute, turning away a shot from Connor Hallisey, then saving Luis Fuentes' effort from the ensuing corner kick. It was the third of what would be five corner kicks for California over the first 45 minutes as the Golden Bears went into the half with an 8-3 edge in shots but nothing to show for it as the Cardinal defense held and kept it scoreless at the break.
Stanford showed the stronger legs in the second half, earning two corners and outshooting California 11-7. The Cardinal forced the Golden Bears onto the back foot multiple times, coming close to taking a deserved lead on more than one occasion.
The first of those major chances came in the 64th minute when Eric Verso was played down the right flank by Aaron Kovar and centered a nice ball for Zach Batteer. With a brief opening at net Batteer sent his effort over the crossbar.
Substitute Mark Verso had a loose ball at his feet in the box a minute later but the California defense was able to close in and block his shot. Koval also had a pair of shots but Taillole gathered in each one.
"Our guys were great all game. When you play against a good team you're not going to be perfect and we don't ask for perfection. What ask for is to keep playing, keep working and always try to be asking questions," Gunn said. "We had good chances and we got very close, and we know that we can beat any team. We have a very tough conference but we know that while respecting every opponent, we're good enough to beat every opponent.
"We're disappointed with the outcome today and the manner in which we lost, but we know that we can be excited and really look forward to the rest of the season because we're playing well ahead of the NCAA Tournament."
On the other side Hutchins did well to cut off angles of California attacks, being in the right lines to scoop up low efforts from Stefano Bonomo and Christian Thierjung.
After California took the lead, Stanford desperately pushed forward in search of an equalizer but Taillole did well to come off his line and secure a pair of Cardinal balls into the box.
Stanford returns to Laird Q. Cagan Stadium next Friday, Oct. 25 for a 7 p.m. non-conference match against San Francisco before resuming the second round of Pac-12 play Nov. 1 against UCLA.