Richard Pitino and his Gophers knew for more than a month they would be playing in the NCAA basketball tournament, but when the official announcement came Sunday evening, they let loose.

Players piled together, taking selfies and waving their arms in the air in front of a jumbo screen showing the selection show at a team gathering at U.S. Bank Stadium. The coach hugged his children and wife, Jill. Minnesota boosters and fans celebrated behind them.

The Gophers’ latest achievement in a major turnaround season occurred when the NCAA tournament selection committee gave them a surprisingly high No. 5 seed and a trip to Milwaukee to play No. 12 seed Middle Tennessee at the Bradley Center on Thursday in the South Region.

“When you have these type of selection shows, you don’t really have a preference who you play,” Pitino said standing in front of the crowd from a microphone. “But you have a preference where you play, and I always circled Milwaukee as a place our great fans could come. So hopefully, we see you guys Thursday.”

The audience responded with resounding applause.

This is Minnesota’s first trip to the NCAA tournament under Pitino. The last time the program played in the Big Dance was in Tubby Smith’s final season in 2013, losing to Florida in the second around after opening with a victory against UCLA in Austin, Texas.

Smith was fired and Pitino was hired shortly thereafter. And while he thought the Gophers were close to making the NCAA tournament his first two years, this was the team everyone around the program expected would finally get them back.

The Gophers (24-8) had a 16-win turnaround from last year’s 8-23 record to set a Big Ten and team record for biggest one-year improvement, which helped Pitino earn Big Ten Coach of the Year honors.

“I just thought internally we did believe,” Pitino said. “We thought we turned the corner.”

Junior guard Nate Mason, an All-Big Ten first-team performer, said the returning players appreciate even more how much of an accomplishment it is to go from a team that finished 13th in the conference last year to the NCAA tournament.

“I don’t know what to say,” Mason said, taking a deep breath. “Just coming from what we came from my first two years, just to see our name on that screen — it’s amazing. It touched all of us once we saw it. The young guys don’t really get it. The older guys, we struggled. It was a struggle to get here. But we stuck it out.”

Minnesota was awarded the second-highest seed of the seven Big Ten teams that made the field of 68. The other conference seeds from highest to lowest were Purdue (4), Maryland (6), Michigan (7), Wisconsin and Northwestern (8) and Michigan State (9).

What boosted the Gophers was their Rating Percentage Index (No. 21), which ranked second-best in the Big Ten after Purdue (No. 20). They also had eight victories against RPI top-50 teams, which led the conference.

Middle Tennessee won’t shrink from a top Big Ten opponent, though. The Blue Raiders (30-4) shocked second-seeded Michigan State as a No. 15 seed in a 90-81 victory in the NCAA first round last year.

But Pitino knows Thursday’s opposing coach well. Before taking over the Gophers, he coached Florida International and beat Middle Tennessee coach Kermit Davis in the Sun Belt Conference in 2013.

The Blue Raiders moved to Conference USA four years ago. They won their conference tournament this year to receive an automatic berth, but they probably would have made the NCAA tournament as an at-large bid. MTSU was ranked 25th in the country after the regular season.

“He’s a terrific, terrific coach,” Pitino said of Davis. “He’s been winning for a long time. He’s a phenomenal coach. They’ve got great talent, so it will be a tough, tough matchup for us.”

The winner of Thursday’s game (3 p.m., TNT) extends its stay in Milwaukee and would play No. 4 Butler or No. 13 Winthrop.

The Gophers, who have won nine of their past 11 games, beat Michigan State on Friday in the quarterfinals of the Big Ten tournament but then lost to eventual tournament champ Michigan in the semifinals on Saturday afternoon. The loss came without guard and senior captain Akeem Springs, who is out for the season with an Achilles’ tendon injury.

Springs’ injury is something the Gophers want to use as motivation to make a run in their first appearance in March Madness in four years.

“We definitely have an edge,” sophomore forward Jordan Murphy said. “But we definitely can’t take anything for granted.”