Stanford answered quickly. Hogan ran 14 yards on a read-option keeper to convert a long third down, fullback Ryan Hewitt bulldozed through the line on a fourth-and-1, and Stepfan Taylor took a short pass 33 yards to within inches of the goal line. On the next play, Hogan faked a handoff and rolled untouched for the tying touchdown.
Taylor finished with 78 yards rushing to eclipse Darrin Nelson's school record of 4,169. Taylor, an outgoing senior, has 4,212 for his career.
Before the Cardinal offense even found their seats on the sideline, Hundley ran 48 yards and scrambled for a 5-yard TD to put UCLA back in front, 14-7.
With the Bruins about to go ahead two scores, Ed Reynolds intercepted Hundley's pass and returned it 80 yards to set up Taylor's short TD run.
Officials ruled that Reynolds, who has returned three interceptions for touchdowns this season, was tackled by Hundley short of the goal line and a replay challenge by Shaw was inconclusive. Reynolds moved into a tie with Oregon State's Jordan Poyer for the Pac-12 lead with six interceptions.
Williamson kicked a 37-yard field goal as the first half expired to give Stanford a 17-14 lead. Fairbairn answered with a field goal from 31 yards on UCLA's opening drive of the second half.
Franklin capped a 12-play, 80-yard drive with a 20-yard TD run late in the third quarter. That gave the Bruins a 24-17 advantage and put Stanford on the brink of its first home loss this season.
Instead, the Cardinal came back in impressive fashion.
After shaking off the safety, Hogan heaved the long touchdown to Terrell just over the cornerback's head. Terrell caught the pass in the short corner and pointed to the poncho-wearing crowd.
"We knew we had to remain calm and play our style," Hogan said. "We kept to it. We pounded the ball, got field position, got the TD to tie it."