MADISON, Wis. -- It did not sit well with Penn State coach Bill O'Brien that his team was spotting Wisconsin 24 points, at least according to the bookmakers in Vegas, in the Nittany Lions' final game of the season.
It apparently did not sit well with O'Brien's players, either.
Behind a sensational four-touchdown performance from freshman quarterback Christian Hackenberg, the motivated Nittany Lions stunned the No. 15 Badgers 31-24, making a mockery of the odds.
"That definitely helped fuel the fire," offensive guard John Urschel said. "Twenty-four points, I think, is a little excessive."
Penn State (7-5, 4-4 Big Ten) had lost each of its previous three Big Ten road games, by the combined score of 131-48. Wisconsin (9-3, 6-2) had allowed just one of its six visiting opponents to get within 28 points. But the usually stingy Badgers' defense had few answers for Hackenberg, who completed 21 of 30 passes for 339 yards, four touchdowns and no interceptions.
Wisconsin quarterback Joel Stave threw a 5-yard touchdown pass to tight end Brian Wozniak to make the score 31-21 with 5:38 to play, and Jack Russell's 48-yard field goal made it 31-24 with 4:13 to play.
But Penn State running back Zach Zwinak, who had been bottled up by the Badgers all night, broke off a 61-yard run on third-and-10, and Wisconsin, out of timeouts, could not stop the clock.
"Great play-calling on Coach O'Brien's part," Urschel said of the draw to Zwinak, who finished with 115 yards on 22 carries.
Safety Ryan Keiser intercepted Stave's desperation heave in the end zone with one second left.
Penn State, which is ineligible for postseason play due to NCAA sanctions, ended O'Brien's second season on a high note against a heavy favorite. The Nittany Lions took exception to the heavy point spread against them during the week.
"That's your bowl right there," O'Brien said. "That's what it is. We came out on top against a very good team. We knew they were good but we knew that we were close to being pretty good."
Hackenberg gave Penn State a 21-14 lead midway through the third quarter with a 7-yard touchdown pass to tightly covered tight end Jesse James. The Nittany Lions added three more points on Sam Ficken's 28-yard field goal after linebacker Brandon Bell knocked the ball out of Stave's hands into the arms of defensive end C.J. Olaniyan, who returned it deep into Badgers' territory.
Hackenberg tossed his fourth touchdown pass of the day and 20th of the season early in the fourth quarter, when wide receiver Eugene Lewis got behind two defenders for a 59-yard score. Wisconsin's usually stingy pass defense was picked apart all afternoon.
"Football becomes really hard to play when you don't rush the passer consistently and you can't protect the passer consistently," Wisconsin coach Gary Andersen said. "It's a bad spot to be in."
The Badgers spent most of the second half playing from behind and had to abandon their top two weapons, running backs Melvin Gordon (13 carries, 91 yards) and James White (13-56).
"When they stack nine, 10, 11 guys in the box depending upon the personnel that you're in, and they take away your run game," Andersen said, "again, football becomes very, very difficult."
Penn State wasted little time getting on the scoreboard. Hackenberg rolled to his right on the game's opening drive and found tight end Adam Breneman, who broke a tackle on his way to a 68-yard touchdown reception.
"I think it set the tone for the game, that we're here to play," said Breneman, who has a touchdown in each of his last three games.
Wisconsin answered with two 11-play scoring drives of 71 and 77 yards, capped by touchdown passes by Stave of 4 yards to Wozniak and 20 yards to wide receiver Jeff Duckworth. The second gave the Badgers a 14-7 lead with 5:05 left in the second quarter.
Penn State caught a break when no one covered Lewis in the left flat and Andersen couldn't get a timeout called before Hackenberg snapped the ball and threw a 3-yard touchdown pass with 1:16 to play in the half.
NOTES: Wisconsin lost at home for just the third time in the last four seasons. The Badgers had won 25 of their previous 27 home games prior to Saturday. ... Penn State has not lost consecutive games under Bill O'Brien since dropping the first two games of the 2012 season. ... Wisconsin had held its three previous Big Ten opponents without a touchdown, but Penn State scored four, including one on its opening drive.