Wisconsin (11-2) now heads to the Rose Bowl where it will face Pac-12 champion Oregon on Jan. 2.
The Badgers turned the tables on Michigan State (10-3), which won the first meeting in October on a last-second Hail Mary pass.
On Saturday, it was the Badgers who scored late, forced a punt and managed to run out the clock when the Isaiah Lewis was called for running into the kicker, giving the Badgers a first down with 1:37 left in the game and Michigan State out of timeouts.
Ball was spectacular early, topping 100 yards in the first quarter, and efficient late, scoring twice in the fourth quarter to rally the Badgers. His 38 TDs scored this season are one short of Barry Sanders' FBS mark (39).
But Russell Wilson was named the game's MVP after going 17 of 24 for 187 yards with three touchdowns and no interceptions. Wilson also broke an NCAA record by throwing a TD pass on the Badgers' opening possession, giving Wilson 37 consecutive games with a TD pass, one more than Graham Harrell's previous mark at Texas Tech.
The loss ruined a pregame prediction by Michigan State coach Mark Dantonio that his team would win and earn the Rose Bowl bid.
It wasn't for lack of trying. Dantonio's team ran a fourth-down pass play, called a fake extra point and even got an impromptu lateral for a score -- just in the first half.
Kirk Cousins made most of it work. Only one of his 17 first-half passes hit the ground in the first half, and he wound up 22 of 30 for 281 yards, three touchdowns and one interception.
But it was his ability to fool the normally stout Badgers' defense that nearly got the Spartans to Pasadena, Calif.
On fourth-and-1 in the second quarter, he got Wisconsin to bite on a fake pitch and hooked up with a wide open B.J. Cunningham for a 30-yard TD pass to cut the deficit to 21-14.
On its next possession, Michigan State receiver Keith Nichol, who wrestled the Hail Mary pass across the goal line to beat Wisconsin in October, beat the Badgers again. This time, he caught a short pass from Cousins and just before stepping out of bounds lateraled to Cunningham, who ran the final 4 yards for a TD. Michigan State then called for a fake extra point that Brad Sontag ran in to make it 22-21.
After playing conventional football for most of the next two quarters and still leading 36-34, the Spartans lined up two different players in the Wildcat formation, ran a reverse and drove for a 25-yard field goal to make it 39-34 with 8:31 left in the game.
But just like the first meeting, the Badgers answered.
Wilson led Wisconsin on an eight-play, 64-yard scoring march, converting a fourth-and-6 when Wilson scrambled, threw back across the field and Jeff Duckworth made a spectacular adjustment to haul in a 36-yard pass. On the next play, Ball burst up the middle for a 7-yard TD, his fourth score of the night Wilson scrambled again on the conversion, finding Jacob Pedersen to give Wisconsin a 42-39 lead.
Keshawn Martin had a career high nine receptions for 115 yards, the second 100-yard game of his career.