CHARLOTTE, N.C. (AP) -Top-ranked North Carolina's best player didn't have a field goal in the second half and picked up a technical foul. The point guard had one assist, and the Tar Heels were in danger of becoming another early season upset victim.
And coach Roy Williams thought it was great.
''I told the guys in one of the huddles, 'You may not believe this right now, but I love this,''' Williams said. ''This is great for us.''
Wayne Ellington picked up the slack for Tyler Hansbrough and Ty Lawson , scoring 20 points and making key plays late to help the Tar Heels avoid a shocking loss in their opener by edging Davidson, 72-68 on Wednesday night.
''Exhibition games are not great for us. We win by 56 and 52, and that doesn't challenge us, it doesn't test us,'' Williams said. ''Tonight did.''
And it showed the Tar Heels have some work to do to be national title contenders.
Trailing for much of the second half, North Carolina closed the game strong. Ellington's free throw with 3:44 left put the Tar Heels ahead to stay. His jumper with just over a minute left made it a three-point game. Lawson, held to one assist with four turnovers, then hit three of four free throws in the final 30 seconds.
Hansbrough had 14 points and 14 rebounds, but was 0-for-1 from the field in the second half, struggling to get shots and getting into foul trouble.
Stephen Curry scored 24 points for Davidson (1-1), which nearly became the latest small school to knock off a major school.
''We were right there,'' Davidson coach Bob McKillop said. ''A possession here and a possession there, that's how close this game was.''
With Mercer beating Southern California and Gardner-Webb stunning Kentucky so far, Davidson was bidding to join the early season surprises. The Wildcats returned all five starters from last season's team that won a school-record 29 games before losing to Maryland in the first round of the NCAA tournament.
They had a tough time stopping Hansbrough early.
Hansbrough, the leading vote getter on The Associated Press' preseason All-America team, dominated the first half with 12 points and 11 rebounds to help North Carolina rally from an early seven-point deficit to take a 38-31 lead.
But Hansbrough and the Tar Heels went cold to start the second half. Hansbrough also lost his cool to help Davidson's comeback.
Hansbrough was called for a foul on Andrew Lovedale while fighting for position on the perimeter with 17:07 left. The two starting jawing and then Hansbrough gave him a slight shove. Referee Mike Wood immediately called a technical foul on Hansbrough, and Davidson turned it into four consecutive points to take a 39-38 lead.
''I got a foul, and I started walking to our huddle,'' Hansbrough said. ''I guess their team was huddling up, and things got congested there.''
Hansbrough went more than 7 minutes without scoring to start the second half and Davidson built a 50-46 lead on Will Archambault's 3-pointer with just under 10 minutes left.
The Tar Heels , who missed 12 of their first 14 shots to start the second half, started going inside with Ellington getting key hoops with Hansbrough on the bench with four fouls.
Danny Green added 11 points for North Carolina, which overcame 19 turnovers.
''It was good for our team to have some key guys get in foul trouble, and players came off the bench and really helped us,'' Hansbrough said.
Curry, the son of former NBA 3-point specialist Dell Curry, was only 8-for-22 from the field and 2-for-12 from 3-point range.
''The No. 1 team in the country and we were right there with them,'' Curry said. ''It shows that we've got better since last year. But we've still got a lot of work to do to win one of these games. We'll have more opportunities.''
It was the start of an ambitious schedule for Davidson, which also plays No. 2 UCLA, No. 13 Duke and No. 21 North Carolina State.
While it was a Davidson home game, the crowd was predominantly pro- Tar Heels . North Carolina agreed to the game to get players acclimated to Charlotte Bobcats Arena, which will host the Atlantic Coast Conference tournament and the NCAA East Regional.
Williams thinks this game will make them that much better come March.
''I think it's great even if you lose,'' Williams said. ''But it's a heck of a lot better to get tested like that and win.''