BOULDER, Colo. (AP) The winning play wasn't actually designed for Brett Hundley to run with the ball.
Try telling him that in the huddle, though.
The junior quarterback saw something he liked - a defensive lineman crashing the play - faked the handoff and scored untouched on an 8-yard keeper in double overtime to give No. 25 UCLA a 40-37 victory over Colorado on Saturday.
''One thing we're really good at is being resilient,'' Hundley said.
UCLA (6-2, 3-2 Pac-12) squandered a 17-point lead in the fourth quarter as Colorado tied the game on a 35-yard field goal by Will Oliver with 36 seconds remaining.
The teams traded field goals in the first OT. The Bruins then stopped the Buffaloes (2-6, 0-5) in the second OT and they settled for a 34-yarder from Oliver.
The play call was for Hundley to hand it off. He saw the defense biting, took the ball back and coasted in for the winning score.
Hundley finished with 110 yards rushing. He also threw for 200 yards and one TD pass, giving him 67 in his career and moving him one away from tying Cade McNown for most in program history.
He struggled with his accuracy on a breezy day, his passes sailing and soaring on him. Nothing wrong with his speed, though - or his improvisation skills at the end.
''In those tough times as a QB, you have to be able to lead your offense,'' Hundley said.
Paul Perkins had a big day, too, rushing for 180 yards and two TDs, including a 92-yard score on the team's first play from scrimmage. That play tied for the second-longest run in school history. The longest was 93 by Chuck Cheshire against Montana in 1934.
Sefo Liufau finished with two TD passes for the Buffaloes. He has 23 TD passes this year and broke Koy Detmer's single-season school mark.
Once again, Colorado struggled at the start, falling behind 17-0 after the first quarter. Last weekend at USC, the Buffaloes were behind 28-0 after the opening 15 minutes on their way to a 56-28 drubbing.
This time, they rallied.
Only, it ended up in another wrenching loss for the Buffaloes, who lost at Cal in double overtime last month.
''I'd like to have some boring games and win them instead of some of the exciting games and keep losing them,'' Colorado coach Mike MacIntyre said.
Down 31-14 late in the third after a short score by Myles Jack, Colorado climbed back into the game behind the right arm of Liufau, who connected with Bryce Bobo for TDs of 38 and 3 yards.
Liufau was leading another drive when Marcus Rios thwarted it with an interception.
Colorado got the ball back after stuffing UCLA on fourth down.
The Buffaloes went on a nine-play, 59-yard drive that culminated with a 35-yard field goal from Oliver.
Colorado suffered a big loss in OT when safety Tedric Thompson was injured on a play. He was strapped to a back board and taken off the field in a cart. He lifted his hands and covered his face as he exited the stadium to applause.
The Bruins led 24-14 at halftime, pushing the team's record to 22-0 under coach Jim Mora when they go into the locker room ahead. They're also 12-4 under Mora in true road games.
''We wanted to see what overtime felt like,'' Mora joked. ''You know, keeping it interesting. ... We're not perfect, got a lot of growing to do, but we are resilient.''
Unlike last weekend, the Buffaloes worked their way back into the game after falling behind early. Trailing 24-7 late in the second, they kept a drive going when Ishmael Adams' interception was negated by a pass interference penalty.
On the next play, Jack snuffed out a trick play by intercepting a pass from receiver Nelson Spruce. That turnover also was negated by a defensive penalty. Mora was incensed on the sideline, ripping off his hat as he complained to the officials.
The Buffaloes took advantage when Michael Adkins weaved his way in from 17 yards to make it a 10-point game.
Colorado had a chance to climb even closer after pouncing on a Hundley fumble deep in UCLA territory. With 24 seconds left, the Buffs thought receiver D.D. Goodson got out of bounds after a catch at the 4. He didn't and the clock was moving.
Unaware, and with no timeouts, Liufau tried to assemble the offense and right tackle Stephane Nembot jumped offside, leading to a time runoff and ending the half. MacIntyre buried his face in his hands in frustration.
''It's my fault on that,'' MacIntyre said after the game.