SALT LAKE CITY (AP) -- Just beating Utah for the first time in five years would have been gratifying for No. 21 Brigham Young.
Winning the way the Cougars did made it a classic.
"It was great to be able to be a part of that BYU magic," said Beck, who passed for four touchdowns in his first win over the rival Utes.
But that was still plenty of time for Beck, who used every second on the clock and a few more. With 3.2 seconds left, Beck rolled to his left and was still scrambling to find an open receiver well after time expired.
Beck reversed to his right, then threw a pass across his body to Harline, who cradled the ball in while on his knees.
"It felt like that last play took forever," said Harline, who caught three of Beck's touchdown passes.
The victory was vindicating for Beck, a senior who threw an incompletion on fourth down to end an overtime loss to the Utes in Provo last year.
"He's a great quarterback and will be measured with the greats here," BYU coach Bronco Mendenhall said. "The longer he held it, the better I felt because I know how difficult it is to cover for that long."
The Cougars erupted in celebration and fans rushed the field after Harline's catch, but BYU still needed to take a knee on the point-after attempt to officially end the game. After four years of frustration, the party could wait just a few more moments.
"The feeling was just complete gratification for our captains, for our seniors and for this program that in two short years have answered a lot of critics," Mendenhall said.
The Cougars (10-2, 8-0) will close the season in the Las Vegas Bowl on Dec. 21. Utah (7-5, 5-3) was still waiting for its bowl invitation.
Ratliff was 24-for-39 for 358 yards and three touchdowns for Utah (7-5, 5-3) and led the Utes to 24 straight points after they fell behind 14-0 in the first quarter. But Beck was slightly better, going 28-for-43 for 375 yards and four touchdowns.
"It's hard to play so well and come up short," Ratliff said. "This is a tough loss for the whole team, but we have another game to play."
After BYU dominated the first quarter, the Utes held the Cougars to minus-12 yards in the second and scored the next 24 points. The Cougars rallied from a 24-14 deficit and took advantage of two pass interference calls to retake the lead.
One of the penalties gave BYU a first down after a third-and-24 and the Cougars scored on a 5-yard pass to Harline with 13:15 left in the game. The Utes blocked the extra point and led 24-20.
Another interference call on third-and-goal from the 10 led to Beck's 2-yard touchdown pass to Daniel Coats, putting BYU up 27-24 with 3:23 left.
Utah still had plenty of time and Ratliff led the Utes 83 yards for what looked like it would be the winning touchdown. Ratliff ran for six yards on fourth-and-2 from the Utah 25 with 2:20 left, then on first down found Casteel over the middle for a 37-yard gain.
From the BYU 19, Casteel caught a slant pass over the middle and had blockers lined up all the way to the end zone.
But the Cougars still had time and Beck went 6-for-9 on the final drive, not counting one play when he spiked the ball to stop the clock. Then Beck, who missed one game this season with injuries to both his ankles, was quick enough on his feet for the final score.
"The last play was just a long play," Utah coach Kyle Whittingham said. "Their quarterback did a great job of staying alive until somebody was open."
Utah outgained BYU 474 yards to 429 despite gaining just 30 yards in the opening quarter.
Louie Sakoda had a 24-yard field goal and ran a fake punt 18 yards to set up Utah's first touchdown, an 18-yard pass from defensive back Eric Weddle to Casteel that cut the lead to 14-7 in the second quarter. Ratliff added a 57-yard touchdown pass to Marquis Wilson and a 4-yard scoring pass to Colt Sampson in the third, giving Utah the 24-14 lead.
Oregon State TE Rocco Carley dismissed for racist language in audio recording
Oregon State freshman tight end Rocco Carley was dismissed from the team after an audio recording surfaced in which he used racist language, coach Jonathan Smith announced Wednesday night.
Missouri LB trying to set an example for younger generations
Missouri linebacker Nick Bolton discusses the team's march from campus to the Boone County Courthouse.
Arizona State punter Michael Turk has NCAA eligibility restored after going undrafted, unsigned by NFL
Punter Michael Turk, who went undrafted and unsigned by the NFL after leaving Arizona State, regained his eligibility and will return to the Sun Devils.
Missouri football players register to vote after leading march
Sixty-two Missouri football players registered to vote Wednesday after leading a march from campus to the Boone County Courthouse in Columbia, Missouri.
Forever my coach: Ryan McGee on how Johnny Majors changed his life
He could coach you up almost as well as he could coach on the football field. Johnny Majors leaves a legacy hard to match.
The 2019 college racial and gender report card
Recent protests have highlighted unequal treatment of and the lack of opportunities for people of color in America. The 2019 colleges race and gender report card is a reflection of that in sports.