STANFORD, Calif. (AP) Arizona has played enough close games at Maples Pavilion in recent seasons to understand the importance of defense down the stretch.
Gabe York made a long 3-pointer with 8:24 left on the way to 19 points, and No. 12 Arizona survived a Stanford rally midway through the second half for a 71-57 victory Thursday night.
Ryan Anderson added 18 points on 7-for-7 shooting and eight rebounds for the Wildcats (16-3, 4-2 Pac-12) in their 12th straight win against the Cardinal dating to a loss on Jan. 4, 2009.
''We've never lost here, and that's an accomplishment in and of itself,'' York said.
Arizona's Kadeem Allen went down in the corner by his team's bench with 10:55 left then briefly left for the locker room before returning.
Grant Verhoeven provided a big lift in the second half for Stanford (10-7, 3-3), but the Cardinal went cold when it counted as Arizona pulled away for good.
Verhoeven's three-point play with 15:35 remaining pulled Stanford within 39-37, then he converted another three-point play at 14:19 before a pair of missed free throws by Kaleb Tarczewski. Verhoeven took a charge at 13:20.
Stanford then made just two of its next 14 field-goal tries and went nearly 9 minutes between baskets.
''I thought our defense was really the constant from start to finish,'' Arizona coach Sean Miller said. ''It might have been our best overall defensive performance.''
Miller won his 299th game and could reach 300 victories Saturday night against California in Berkeley.
Arizona, the two-time defending Pac-12 champion picked to win again, has won three in a row since a 103-101 four-overtime loss at USC on Jan. 9.
Arizona's 12 straight wins in the series mark the program's longest active winning streak in the conference against any opponent - but the previous two games on Stanford's home floor in Maples Pavilion were decided by 10 total points.
Two years ago and ranked No. 1, Arizona escaped with a 60-57 win, then an 89-82 victory by the seventh-ranked Wildcats last January.
''We were a little hesitant because they played so many different zones,'' York said. ''In the second half, we settled in, played well, tight defense.''
Marcus Sheffield scored 17 points for the Cardinal, coming off a 77-71 win against Bay Area rival Cal on Thursday. They faced a team either ranked or receiving votes in the AP poll for the fifth time in six games and shot 4 for 21 from 3-point range.
''We had a little lapse in the second half defensively,'' said Stanford's Dorian Pickens, who added 11 points. ''They got in a rhythm there and got comfortable.''
Arizona's Parker Jackson-Cartwright, who had two big games in sweeping the Washington schools last weekend with 13 total points and 18 assists, was limited to no points and three assists.
The Cardinal began the game 1 for 8 to fall behind 12-4 but Arizona had an offensive drought of its own missing nine of 10 shots during a stretch late in the half as the Cardinal stayed within 31-30 at the break.
''We gave up 40 second-half points,'' Stanford coach Johnny Dawkins said. ''They made the stops in the second half when they had to. We went through a drought of not scoring the basketball.''
Anderson knew he had shut down Stanford leading scorer Rosco Allen, who went 1 of 12 for four points - including missing all but one of his seven 3-point attempts.
''Definitely that was a big point of emphasis,'' Anderson said. ''He's had his way with the league so far. When you play against a guy like that it brings out the best in me.''
Arizona: The Wildcats committed nine first-half turnovers but outrebounded Stanford 42-29. ... Miller is 11-0 against Stanford and 50-18 against universities from the state of California, with the Wildcats winning 13 of their last 19 games in California during the regular season and NCAA tournament.
Stanford: Jim Plunkett, Stanford's only Heisman Trophy winner, sat courtside next to fellow quarterback and two-time Heisman runner-up Andrew Luck of the Indianapolis Colts. ... The Cardinal are 12-22 against ranked opponents under eighth-year coach Dawkins. Arizona was the second-highest ranked team Stanford faced after a loss to No. 8 Villanova in November. The Cardinal beat No. 21 Utah 70-68 in overtime at home Jan. 1.
Arizona: At California on Saturday.
Stanford: Host Arizona State on Saturday.