Arizona had a shot at pulling off the win after the Buffaloes' Carlon Brown missed a 3-pointer at the 30-second mark and the Wildcats corralled the rebound.
Arizona coach Sean Miller had used its last timeout at 2:51, however, and the Buffaloes chose not to foul. The Wildcats worked the ball around for a good look but the ball didn't come close.
Brown's 19 points led the Buffaloes (13-6, 5-2 Pac-12), who trailed 39-35 at the half and didn't get much production from Andre Roberson, who came in averaging a double-double but was held scoreless and pulled down just seven rebounds in 25 minutes.
Brown hit the go-ahead 3-pointer with 1:18 showing.
Jesse Perry had 20 points and 10 rebounds for the Wildcats (13-7, 4-3) in their first trip to Boulder since Dec. 9, 1973.
"We knew coming in that it was going to be a dogfight," CU coach Tad Boyle said. "Arizona is a well-coached, tough, experienced team. We knew we would have to play well to beat them, and we played well enough. We made one extra play and I thought it was appropriate that we won that game on the defensive end. That's what makes me the happiest and the most proud. I'll take Carlon's shot obviously, but winning that game on defense, which is what we're preaching, and it was appropriate.
Winning a game where you shoot 40 percent from the field, giving up 18 offensive rebounds, one of your best players goes 0-for-8 from the field...what a team victory. I thought that it was one of those games where the team that makes the most plays wins, and I think we made one extra play than they did."