1 of 2
Joe Jaszewski, AP
Wyoming players celebrate a win over Boise State in an NCAA college football game Saturday, Oct. 29, 2016, in Laramie, Wyo. (Joe Jaszewski/Idaho Statesman via AP)

LARAMIE, Wyo. — Defensive tackle Chase Appleby sacked Brett Rypien and forced a fumble that bounced out of the back of the end zone for a safety with 1:25 left to give Wyoming a 30-28 upset victory over No. 13 Boise State on Saturday night.it

"I tried to put a good hit on him, and I saw the ball fly out," Appleby said. "I wanted to recover it for another score but we'll take the safety."

It was Wyoming's first win over the Broncos in 11 games between the two teams and its first victory over a Top 25 team since beating No. 22 Air Force in 2002. Thousands of fans swarmed the field and the Cowboys' players as the final seconds ticked off.

Josh Allen completed 18 of 31 passes for 274 yards and three touchdowns, and Brian Hill ran for 146 yards for the Cowboys (6-2, 4-0 Mountain West).

Rypien completed 22 of 35 passes for 295 yards, and caught a 33-yard TD pass on a trick play for Boise State (7-1, 3-1). Jeremey McNichols ran for 143 yards and two TDs, and Jake Hollister caught six passes for 144 yards and two touchdowns.

The game featured two of the top running backs in the nation in Hill, who entered the weekend second in rushing, and McNichols, who was No. 6. Wyoming outgained Boise State 489 yards to 487.

Wyoming, which trailed 21-7 in the first half, tied it on a 27-yard TD pass from Allen to Tanner Gentry, followed by a 2-point conversion on a pass from Allen to Jake Maulhardt with 6:42 left in the fourth quarter.

The teams traded possessions with Boise State getting the ball at its own 10-yard line with 1:38 remaining.

After an incomplete pass, Rypien was sacked by Appleby near the goal line and the bounced through the back of the end zone.

"We trust Brett, and they made a play," Boise State coach Bryan Harsin said. "He's trying to get the ball out. This is football, this is every week football and sometimes that ball bounces funny and it came out and they got the safety at a critical time in the game."

THE TAKEAWAY: Boise State saw its hopes of cracking the AP Top 10 and eventually earning a spot in the College Football Playoff dashed. The Broncos needed an unblemished record to do that.

Wyoming's win shows it's a program on the upswing. The team is stocked with youth and is vastly improved under the direction of coach Craig Bohl after finishing last season 2-10.

Entering Saturday's game, Boise State had beaten Wyoming in five previous contests between the two teams at Laramie by an average of 30.8 points.

POLL IMPLICATIONS: Boise State will likely fall in the poll. The question is how far. Wyoming might get consideration from a few poll voters, but it certainly will draw more attention the rest of this season and next year.

UP NEXT

Boise State: The Broncos return home for a game against San Jose State this Friday night. It is the second of three Friday night contests for Boise State this season. The Broncos are 27-7 in Friday night games.

Wyoming: The Cowboys host Utah State next Saturday. Utah State is last in the conference's Mountain Division.

More AP college football: www.collegefootball.ap.org