BUFFALO, N.Y. -- Down goes 'Nova.

Nigel Hayes scored 19 points and made the winning layup with 11.4 seconds remaining as No. 8 seed Wisconsin upset defending champion Villanova 65-62 on Saturday in an NCAA Tournament second-round game at KeyBank Center.

"Seeds don't matter," Wisconsin coach Greg Gard said after his team beat the top-seeded Wildcats. "I told these guys, I don't care where we're seeded. We have to win six games. Let's start with these two this weekend."

Bronson Koenig added 17 points, including two late 3-pointers, for the Badgers (27-9), who are returning to the Sweet 16 for the fourth straight season. Ethan Happ had 12 points and eight rebounds and Vitto Brown scored 10 points.

The loss ended top-seeded Villanova's quest to become the first repeat national champion in 10 years.

Josh Hart had 19 points for the Wildcats (32-4). Donte DiVincenzo added 15 points and Jalen Brunson had 11.

"To me, there's no dishonor in losing in this tournament," Villanova coach Jay Wright said. "But I do know that, and we've lived through it, you are judged by how you play in this tournament, and that's the reality of it. So, you have to accept it."

This was Wisconsin's third victory over a No. 1 seed in the last four years.

"All those games we've been the underdog," Hayes said. "You have all types of your ranking systems, statistics, analytics guys that they put. The thing with all those algorithms, they can't calculate heart, will to win, toughness, desire. They can't put that into a formula to come out with a percentage chance to win, and that's the thing that we have."

Wisconsin shot 53 percent, improving to 17-0 this season when making more than 45 percent of its field goals. The Badgers also had a 32-22 advantage in paint points.

Neither team led by more than eight points in a game that went down to the wire.

After DiVincenzo stole the ball at midcourt and made one of two free throws to tie the game, Hayes drove the baseline and scored on a reverse layup to put Wisconsin ahead 64-62 with 11.4 seconds left.

Hart worked his way into the paint to try and tie the game for Villanova, but Happ held his ground inside and Hart lost the ball.

Brown was fouled after coming up with the loose ball but he missed the second of two free throws with 3.4 seconds remaining. DiVincenzo grabbed the rebound, but Villanova was unable to get off a shot.

"Give them all the credit," Hart said. "They're a heck of a team. They made great adjustments."

The Badgers trailed by seven points with six minutes remaining but rallied to tie the game on a Koenig 3-pointer with 3:27 to go. Koenig, who sat for more than 10 minutes of the second half after picking up his fourth foul, hit another 3 to give Wisconsin a 62-59 lead at the 2:00 mark.

"I felt terrible, to say the least, when I got my fourth foul," Koenig said. "I knew that's not how my career was going to end. I knew that when coach gave me the opportunity to get back in there, I was going to make something happen."

Villanova took its first lead since the early stages of the game on Brunson's layup that made it 39-37 with 13:28 remaining. The Wildcats went on a 6-0 run while the Badgers turned the ball over on three straight trips.

Wisconsin led for all but 3:25 of the first 25 minutes. The Badgers used an 11-2 run to take their largest lead, 20-12, midway through the first half and went into halftime ahead 31-27.

For the second straight NCAA Tournament game, Villanova started slowly, shooting below 30 percent (8 for 27) in the first half. In the first round against 16th-seeded Mount St. Mary's, the Wildcats went 5 for 21 before clawing their way back in the game.

NOTES: Wisconsin has won 13 NCAA Tournament since 2014, the most of any team during that span. ... Villanova had won its last 69 straight games when holding an opponent to 65 points. ... Villanova lost in the second round as a No. 2 seed in its last NCAA Tournament appearance in Buffalo in 2014. ... Villanova had a season-low five assists. ... Wisconsin, the worst free-throw shooting team left in the NCAA tournament, went 7 for 16 from the line.