For most of the night, the Battle of the Bay between the area's two ranked women's basketball teams looked like the Rout of the Drought.

No. 4 Stanford had a 30-point lead on No. 21 Cal early in the second half, and it looked like the only drama concerned whether the Bears would get to shoot a single free throw.

Instead, they staged a spectacular comeback behind guards Brittany Boyd and Afure Jemerigbe. They cut the lead to five points before Stanford hung on for a 70-64 win that had most of the 4,228 fans at Maples Pavilion on the edges of their seats.

"We had a lot of people missing point-blank shots," Stanford coach Tara VanDerveer said. "Whether it was a lack of focus, we didn't keep the pedal to the metal. We don't feel good about how we finished. We didn't put them away."

Stanford (20-1 overall) finished the first half of the Pac-12 schedule with a 9-0 record. The Cardinal play the Bears (14-6, 6-3) on Sunday at 1 p.m. in Berkeley, and if Cal can preserve its late momentum from Thursday night, the rematch should be quite interesting.

"We have a bunch of competitors in our locker room," Bears coach Lindsay Gottlieb said. "They'd like to drive back and play (Stanford again) 10 minutes from now."

Gottlieb decided not to order her players to intentionally foul in the closing minutes despite the deficit. The strategy paid off because Stanford made just two baskets in the final 7:40, the Cal press was working, and the Bears were hitting everything.

Boyd scored eight straight of her team's points, the final two on a jumper that made it 69-61 with 37 seconds left. Jemerigbe's three-pointer with 18 to go cut the lead to 69-64. But Mikaela Ruef sank one of two foul shots, and Gennifer Brandon's misfire was rebounded by Stanford's Chiney Ogwumike with five seconds left.

It was Stanford's sixth straight win over a ranked team after a loss to No. 1 UConn in November.

A 12-0 run put Stanford up 59-29 with 13:35 to go. It looked like easy street for the Cardinal, especially since the Bears couldn't get to the foul line. Cal finally got there 12 times and made half. Stanford was 11-for-16 on free throws.

"I'm disappointed in the outcome," Gottlieb said, "but I'm proud of our team's fight and our heart. We had a rough stretch obviously at the end of the first half and the beginning of the second half."

The huge rally "is something that we can build on and something that we're excited about," she said.

Cal is easily the worst three-point shooting team in the Pac-12, making just 24 percent of its tries, while Stanford entered the game as the best at 41 percent. Cal, however, made six treys (in 16 tries), while Stanford was 5-for-19.

"One thing about this team," Boyd said, "is we have heart. Even if we're down 50, we're not going to give up."

The Bears nearly had a win for the books. They simply ran out of time.