LINCOLN, Neb. (AP) Maryland coach Mark Turgeon told his players early in the week that they would impress the NCAA Tournament selection committee if they could win their last two road games.
On Saturday he told them that if they beat Nebraska on Sunday night, they would set the school record for wins in a regular season.
The coach's motivational talks must have helped, because the 10th-ranked Terrapins were pushed to the limit before getting out of Lincoln with a 64-61 win.
Dez Wells made a contested 18-foot jumper with 8.8 seconds left after Nebraska had made it a one-point game, and Shavon Shields missed what would have been a tying 3-pointer in the last second.
Maryland (26-5, 14-4), runner-up to Wisconsin in its first Big Ten season after being picked 10th in the preseason, heads into this week's conference tournament in Chicago on a seven-game win streak.
''Twenty-six wins. We found out yesterday that we had a chance to set a record, most wins in a regular season, and we really dialed in,'' Turgeon said. ''I think because that number was sitting out there, we stayed focused and kept trying to get it done.''
Freshman guard Melo Trimble scored 21 points, Wells had 18 points and 12 rebounds, and Jake Layman added 11 points for the Terps.
''This team, I've always thought we could do anything. Twenty-six wins, I knew we'd get it as long as we played our game,'' Trimble said. ''Coach Turgeon told us we were on the way to breaking the school record. Once he told us that, we really wanted it.''
Regular season-ending road wins at Rutgers and Nebraska gave Maryland a 5-4 Big Ten road record, and the Terps also had a December win at Oklahoma State.
''They say we're a 3, 4 or 5 seed in the NCAA Tournament,'' Turgeon said. ''The committee likes road wins. We had two chances to get road wins this week, and our guys took advantage of it.''
Shields had 26 points and Terran Petteway added 19 for the Cornhuskers (13-17, 5-13), who lost their eighth straight.
Shields' three-point play with 43 seconds left pulled the Huskers to 62-61. The Terps called a timeout with 11 seconds left and 4 on the shot clock. Wells took the inbounds pass and hit his shot from the wing.
Nebraska outscored Maryland 23-21 at the free-throw line, but made only 12 of 22 in the second half.
Maryland went on a 10-0 run to take the lead for good after Nebraska had gone up 48-43.
Nebraska coach Tim Miles said he had a ''devastated locker room'' after the game. The Huskers are the No. 12 seed in the conference tournament and play Penn State on Wednesday.
''Just play your butts off and let destiny lay where it is,'' Miles said he told his team. ''If we ended up losing whatever in a row out, big deal. Just play your butts off. That's what we did today. We gave ourselves a chance.''
LOCKER ROOM BAN ENDS
Miles on Saturday ended the locker room lockout he imposed after the Huskers lost by 28 points to Iowa on Feb. 22. Miles had said his players' effort didn't merit them having access to one of the most posh locker rooms and lounges in college basketball.
LOTS OF FOULS
Officials called a combined 51 fouls in a grinding game. Turgeon was surprised one didn't get called when he ordered that Petteway be fouled on Nebraska's last possession. ''We were trying to foul,'' he said, laughing. ''We weren't trying to foul for those other 27 fouls, but we were trying to foul then.''
Maryland: The Terps' 26 wins mark a nine-game improvement from last season. ... The 26 wins match the most in a season in Turgeon's 17 years as a head coach. His 2005-06 Wichita State team, which went to the Sweet 16, also won 26. ... The 7-foot-1 freshman Michal Cekovsky was back after missing two games with a left knee injury.
Nebraska: The eight-game losing streak is the program's longest since a nine-game skid in 2002-03. ... F Walter Pitchford returned after missing a game with a hip flexor injury.
Maryland plays in a Big Ten Tournament quarterfinal Friday.
Nebraska plays Penn State on Wednesday in the Big Ten Tournament.