LOS ANGELES — Tyrell Terry scored 24 points, including 18 in the second half, and Stanford beat UCLA 74-59 on Wednesday night for its first victory at Pauley Pavilion since January 2005.

Spencer Jones added 14 points for the Cardinal (15-2, 4-0 Pac-12), who were playing their first conference road game of the season.

Jaime Jaquez Jr. scored 15 points and Jalen Hill added 14 with 12 rebounds for the Bruins (8-9, 1-3), who are mired in their second three-game skid of the season. They had won 13 straight home games against the Cardinal.

UCLA trailed just 38-37 after a Jaquez layup with 15:28 left, but the Cardinal responded with 12-2 run to take control.

A Lukas Kisunas dunk gave the Cardinal its first double-digit lead, 49-39, with 12:06 left. Stanford’s edge did not shrink below eight the rest of the way.

UCLA head coach Mick Cronin was called for a technical foul late in the game that led to two free throws by Terry. The Cardinal freshman scored 13 straight points, capped by a 3-pointer that beat the shot clock and extended Stanford’s lead to 71-52.

The Cardinal raced to an 18-9 lead to open the game, making 7 of 10 shots; UCLA opened 3-for-10 from the field.

But the Bruins turned things around quickly, putting together runs of 9-0 and 11-0 to take lead 29-22. UCLA made six consecutive field-goal attempts during one stretch of the 20-4 spurt in which seven players scored. David Singleton had five of his 11 points in the run.

Stanford regrouped and outscored UCLA 11-2 to end the half leading 33-31.

The Cardinal shot 51.1% from the field and held the Bruins to 39.6% for the game.

Stanford’s success came despite a subpar outing from leading scorer Oscar da Silva. The junior forward, who entered the game averaging 16.5 points per game, was limited because of foul trouble and scored six points on 2-for-5 shooting.

Beth Harris is an Associated Press writer.