The Gophers knew what was at stake for them on Senior Night — the best victory on their NCAA tournament résumé. They also knew Purdue was playing for a chance to win a share of the Big Ten title.

It wasn’t just a case of which team wanted it more. The Gophers seniors clearly gave it everything they had in their last Big Ten home game.

It came down to whether or not they could play well enough down the stretch to pull off the upset.

After watching a 12-point lead in the second half disappear, the Gophers again steadily built up their advantage, then fought off a late rally by No. 11 Purdue for a 73-69 victory Tuesday night that had the fans storming the court at Williams Arena.

“It was an important win,” Gophers coach Richard Pitino said. “I think personally that solidified us to go to the NCAA tournament. Season’s not over, obviously. We want to go to try and get a tough win vs. Maryland.”

VideoVideo (13:39): Gophers coach Richard Pitino, Jordan Murphy and Matz Stockman talk after Tuesday's upset over No. 11 Purdue

The last time Minnesota had a court-storming was when the Gophers upset No. 6 Maryland in 2016, but that came during an eight-win season, when Jordan Murphy and Dupree McBrayer were freshmen.

The program has come a long way since then.

“Most kids transfer and go somewhere else,” Pitino said. “They believed in a young coach in me who was trying to build a culture and stuck with it. I’m really, really proud of those guys.”

Murphy finished with 13 points and 14 rebounds. McBrayer had 10 points. Junior Amir Coffey tied his career high with 32 points for the Gophers (19-11, 9-10 Big Ten), who finish the regular season Friday at Maryland.

The Boilermakers (22-8, 15-4), who are now tied for first place with Michigan State and Michigan, were led by Carsen Edwards’ 22 points, but the loss ended their five-game winning streak.

Entering Tuesday, the Gophers sat firmly on the NCAA tournament bubble and hadn’t picked up a Quadrant 1 victory since Jan. 3 at Wisconsin. In fact, the Gophers had lost seven consecutive games considered in the highest-quality category by the tournament selection committee. The opportunities were running out.

That’s why they were clearly playing with a sense of urgency when they jumped out to a 37-25 lead after Coffey’s seventh consecutive point late in the first half. Coffey recorded his second big game in a row, after he had 31 points and 12 rebounds Thursday at Northwestern.

“We haven’t had pressure like that since probably my sophomore year,” said Murphy of Minnesota’s last NCAA tourney appearance in 2017. “It was good to see our guys step up.”

In the second half, Purdue showed championship grit by using a 9-0 run to tie the score at 54-54 with 8:34 left. The Gophers, who had 14 turnovers Tuesday, squandered several possessions in a row, showing glimpses of how they blew a 13-point lead in a 10-point loss Feb. 3 at Purdue.

They reclaimed the lead on two Coffey free throws, and Matz Stockman added a free throw after a flagrant foul on Evan Boudreaux.

Chants of “MVP, MVP” came from the Gophers faithful for the 7-foot senior, who played 24 minutes with backup center Eric Curry out for the season because of a right foot injury. Stockman’s nine points, six rebounds and seven blocks were a huge lift.

A minute later, Gabe Kalscheur’s three-pointer and Stockman’s dunk highlighted a 10-1 run for the Gophers, who took a 64-55 lead on Coffey’s layup with 3:46 to play.

The Gophers appeared on the verge of pulling away, but Ryan Cline hit his fifth and sixth three-pointers to keep Purdue within striking distance. Like so many close games this season, Pitino and his players had to sweat out the waning seconds.

Edwards nailed a late three to cut it to 71-69. With 3.9 seconds left, the Gophers messed up an inbounds play, as the ball nearly hit Coffey going out of bounds on the sideline. But the official ruled it was off Purdue, and a review provided no clarity, so the Gophers retained possession. Coffey’s two free throws then sealed the biggest victory of the season and sent students sprinting out onto the raised floor.

“It was amazing,” Stockman said. “It was the best kind of way you can go out, winning against a top team and doing that at home on Senior Night.”