A fourth-quarter, go-ahead touchdown followed by a last-minute blocked field goal helped No. 14 Boise State avoid a major upset Thursday night as the Broncos held on for a 28-27 victory over BYU.

RELATED: Remaining undefeated college football teams

Early on in the night, it seemed like Boise State (7-0) would run away with the game when the Broncos jumped out to a 14-0 lead in the first quarter. But an inability to hang on to the football gave the Cougars life. BYU (4-4) returned two interceptions for touchdowns in the second quarter, the second of which gave the visitors the lead.

The game would continue to seesaw back and forth until a Boise State touchdown with 10 minutes left in the contest put the Broncos up by one.

But BYU would get another chance. The Cougars worked their way up the field in the waning seconds to set up a potential game-winning 44-yard field goal.

It was blocked.

BYU recovered the ball eight yards back (and out of field-goal range) with 10 seconds left, giving it yet another opportunity to pull off the upset, but an incomplete pass and a failed Hail Mary ended that hope, leaving Boise State as one of 11 FBS teams left undefeated.