NEW YORK -- Shabazz Napier turned a sweet steal into an assist for the basket that had UConn rolling with a 17-point lead.
His braggadocio got him a technical foul. His foul trouble took him out of the game.
Maryland took advantage of those breaks to fuel a fantastic comeback -- just not a win.
Napier scored 18 points, Niels Giffey had 13 and No. 18 Connecticut survived Maryland's second-half surge in a 78-77 victory Friday night.
"We learned we can dig down deep and pull it out no matter what," Napier said.
The Terrapins dug as well and made it a game in the final minutes at Barclays Center in the season opener for both teams.
Nick Faust scored five straight points on a layup and 3-pointer to bring the Terps within two with 2:28 left.
Tyler Olander drilled a 3 for UConn with 2 minutes left for the shot of the game to make it 78-73. Napier was whistled for his fifth foul and Dez Wells made two free throws to cut it to 78-75. Wells hit a jumper out of a Maryland timeout and it was a one-point game.
UConn twice missed the front end of 1-and-1s.
Wells, who scored 10 points in the second half, missed twice on potential go-ahead shots.
"We still have a lot to look forward to this season," Wells said.
With former coach Jim Calhoun in attendance, UConn is set for a new beginning under second-year coach Kevin Ollie. The Huskies went 20-10 last season, but failed to qualify for the NCAA tournament because of poor academic progress rates that predated anyone on the current roster.
"I don't care if we don't play for the NCAA tournament, I don't care if we do," Ollie said. "I don't have no pressure. The guys don't have no pressure. Hopefully, we get back into the NCAA tournament, but it's going to be one game at time, one practice at a time."
They surely felt some as they let a blowout slip into a close one.
"This would have been a great win for us because I think Connecticut is going to win a lot of games," Maryland coach Mark Turgeon said.
The Huskies have more wins in one game than the football team (0-7) had entering Friday night. In an effort to get more fans to come and watch the winless football team, UConn opened the gates at Rentschler Field early and showed the basketball game on the video board before the Huskies played No. 20 Louisville.
UConn center Amida Brimah, out of Ghana, turned Maryland's ninth turnover midway through the second half into a true rim-rattling dunk. The 7-footer left the backboard swaying even as Maryland scored on the other end. By the time it settled, Omar Calhoun came down and swished a 3-pointer for a 59-47 lead.
Napier and Calhoun connected on consecutive 3s, stretching the lead to 65-50. Ryan Boatright turned the Barclays Center into Gampel Pavilion with one more fastbreak dunk that brought the crowd to its feet.
With the Huskies up 67-50, Napier was whistled for the technical foul, he said for boasting about his play.
"I apologized for talking," he said.
Layman hit two 3s during an 11-0 run following the "T" to make it a game, using the long-distance sharp-shooting the Terps needed in the first half.
"I'm disappointed in our guys in the first half, no toughness," Turgeon said. "Second half, we really competed."
Brimah had three blocks in only 8 minutes in the first half, including consecutive rejections that pushed the lead to double digits. The freshman center blocked one shot, but the Huskies missed on the other end. Brimah had a block the next time down, and Giffey capitalized for the Huskies with a 3-pointer for a 41-31 lead.
Brimah had three blocks, five points and three rebounds in 15 minutes.
"He's going to be a force," Ollie said. "The kid is going to be great if he keeps that passion about the game. He loves the game. You don't see a lot of people with that love for the game."
Giffey's stock rose over the summer with his play for the German national team at EuroBasket 2013 in Slovenia. After averaging 4.9 points last season at UConn, Giffey averaged more than 9.0 points for the German team playing against mostly professional competition.
Brimah's dunk for his only field goal of the half gave UConn a 13-point lead. The Huskies hit 6 of 13 3-pointers to lead 48-36 at halftime.
"We didn't do the necessary things to be a championship team," Ollie said. "We'll get there. I do like the ending, though."