Six weeks ago, following a loss to Virginia that Coach Mark Turgeon called “rock-bottom,” even a National Invitational Tournament berth seemed a distant and unrealistic ambition for the Maryland men’s basketball team. The Terrapins were 5-6 in the ACC, turnover prone and inconsistent, their season veering into volatile waters.

Maryland righted the ship a bit since then, toppling Duke twice and advancing to the ACC tournament semifinals. But it wasn’t enough to earn its first NCAA tournament bid since 2010. Instead, Maryland will host Niagara in the first round of the NIT on Tuesday night.

Turgeon, who took Texas A&M to four straight NCAA tournaments before coming to College Park in 2011, has traditionally held Selection Sunday celebrations at his house. But upon losing to North Carolina by three points in Saturday’s ACC semifinals, Maryland instead flew home with no viewing party planned, forced to brace for a consolation prize. The players didn’t watch Sunday’s NCAA tournament selection show, but gathered for dinner and a meeting, where Turgeon revealed their fate.

The NCAA tournament snub came as little surprise. Even with the two wins over Duke, the Terrapins doomed themselves with a soft nonconference schedule and a 4-10 record against teams ranked in the top 100 in the Ratings Performance Index, a metric used by the NCAA tournament selection committee.

When Turgeon scheduled the likes of Maryland-Eastern Shore (which ranked 345th out of 347 Division I teams in terms of RPI), South Carolina State (342) and IUPUI (327), he was dealing with a thinned roster, unaware that Logan Aronhalt, Dez Wells and Charles Mitchell would arrive for the upcoming season. According to rankings compiled by statistician Ken Pomeroy, the Terrapins’ nonconference schedule ranked 345th out of 347 teams nationally.

Losses at Georgia Tech and Boston College — ACC teams ranked worse than 100 in the RPI — pushed Maryland outside the bubble, while a regular season-ending collapse at Virginia might have sealed its coffin.

“We’re excited about this,” Turgeon said Sunday night on a conference call with reporters. “We were disappointed in our loss yesterday, kind of had a feeling when the game ended that we were going to be an NIT team, and we approached it that way ever since the game ended.

“The whole key is we continue to get better and play at a high level. My biggest concern is we played Sunday night on the road, then Thursday, Friday, Saturday. My biggest concern is getting them fresh mentally and physically. The good thing is we did come home last night. We didn’t have to travel today, which is great. Just getting them fresh and getting them ready, getting them prepared.”

Since 1993-94, only three teams have beaten the top-ranked RPI team twice in the same season. Both Wake Forest, which swept North Carolina in 1994-95, and the Tar Heels, who did the same to Duke in 2008-09, made the NCAA tournament. Maryland did not.

Tack on an 0-5 record away from College Park against the RPI top 50, and Maryland can host up to two games at Comcast Center. With a win over Niagara (19-13), the Metro Atlantic Athletic Conference regular season champion, the Terps will face the winner of a game between Denver and Ohio. That date has not been set.

“In the big picture, we think that if we can get in the tournament, we’ll do well and play well,” point guard Pe’Shon Howard said Saturday. “If we get in the NIT, we think we can compete to win it. Just the fact that we’re playing, we really feel positive about our team.

“We play for each other, for the people in this locker room. Whenever we get on the court, step between the lines, we don’t want to let anyone down. That’s our main motivation.”

Said Turgeon: “Guys are excited. They’re happy with the way they played this weekend, they competed, they played until the final buzzer in every game, and that confidence should serve us well heading into Tuesday.”