There were sure to be all kinds of challenges during this long season, so why not a game that tested Maryland's fortitude -- and its patience -- with its postseason survival at stake against an unheralded team maddeningly well schooled in the Princeton offense?

After another slow start, second-seeded Maryland -- and particularly Dez Wells -- had to dig deep to come back and defeat Denver, 62-52, on Thursday night to advance to the quarterfinals of the National Invitation Tournament.

Maryland (24-12), which won by using a five-guard lineup in the second half for the first time all season, moved to within one victory of a trip to Madison Square Garden for the NIT semifinals. The Terps will next meet the winner of Saturday's Alabama-Stanford contest on Tuesday night.

If top-seeded Alabama wins on Saturday, the Crimson Tide will host the Terps. If Stanford wins, the Cardinal will travel to Comcast Center.

Maryland found itself in a bind in the second half, facing a nine-point deficit to the Pioneers with 9:15 left.

"We didn't want the season to end," coach Mark Turgeon said. "I was nervous all day. I knew this was going to be a hard one for us -- six games in 12 days."

The Terps have won four of five games since the regular season ended, and Turgeon has been particularly enjoying the late-season run.

"We couldn't have done that [sort of comeback] six weeks ago. There's no way," Turgeon said.

It's difficult to come back against Denver (22-10), which had won 11 of its previous 12 games, because the Pioneers are adept at running the clock and rarely turn the ball over. Former Princeton player Joe Scott coaches the Pioneers, and they run an effective variation of the Princeton offense.

The Terps also weren't at full strength because 7-foot-1 Alex Len was struggling and in foul trouble. With Len on the bench, the Terps went to a small lineup of five guards in the second half. Wells, who is 6-5, became an inside player, slashing to the basket or posting up.

"In another life, I played the post," Wells said. "We knew if we kept grinding it out, they would get tired. We're a deep team."

About the Terps sophomore, Scott said: "Wells was the difference today. You've got to give them credit."

With students on spring break and the NCAA tournament on television, the game was played in front of a tiny, but noisy crowd of 3,982.

Maryland not only hadn't played five guards at once in a game this season, but the Terps had barely practiced with such a lineup, if at all, according to the players.

Turgeon said his strategy was "to spread them out and get to the foul line."

Turgeon said his mentor, Larry Brown, used to tell him to trust his instincts in games and "figure it out. We figured it out."

Wells, who had a team-high 19 points, scored five straight points to cut the deficit to 50-47. Moments later, a drive and basket from Seth Allen put Maryland on top, 51-50, with 4:12 left, and the Terps didn't trail after that.

Junior Chris Udofia led third-seeded Denver, scoring 24 points -- but only five of them after halftime.

"That was fun," Turgeon said. "It was nerve-wracking until about the eight-minute mark, but it was fun at the end."