CHAPEL HILL, N.C. (AP) -- Courtney Banghart watched the final seconds tick away and gave a fist pump while her North Carolina players ran onto the court to mob each other in celebration.
For the second time in a year, the Tar Heels have handed a highly ranked North Carolina State team its first loss of the season - this one giving the new UNC coach her first win in the longtime rivalry.
Shayla Bennett scored 20 points and the Tar Heels rallied from 12 down in the third quarter to beat the ninth-ranked Wolfpack 66-60 on Thursday night, knocking off one of the nation's last four unbeaten teams.
''This wasn't one of those games where they didn't play well and we just hit everything,'' Banghart said. ''It was, we had to grind it, and they really shot the ball well. And it took an added element of trust in that moment, of just to stay: 'Stay with us, stay with us, stay with us.'''
Banghart left Princeton last spring to take over for Sylvia Hatchell in the program's first coaching change since 1986. She was charged with restoring a program that used to regularly contend for Atlantic Coast Conference championships, while she was also replacing a Hall of Fame coach with more than 1,000 wins before resigning after an investigation into concerns over player treatment.
Now she has a marquee win to reinforce the lessons her staff is teaching her new team.
''She gives each and every player confidence,'' said senior Taylor Koenen, who had 14 points and 11 rebounds. ''She doesn't let us dwell on anything. She believes in us and makes our teammates believe in each other, too, so I think that's a huge part.''
The Tar Heels (12-3, 3-1) pushed ahead for good on Madinah Muhammad's free throws with 8:14 left, then repeatedly came up with tough baskets to gradually tighten their grip on the game down the stretch.
It also came less than a year after the Tar Heels won in Raleigh against a Wolfpack team ranked No. 7 and standing as the nation's last unbeaten Division I team on the men's or women's side at 21-0.
Aislinn Konig scored 24 points for the Wolfpack (14-1, 3-1), who went more than 10 minutes without a basket after taking a 46-34 lead with 5:10 left in the third quarter. N.C. State shot just 7 of 30 (19%) after halftime, while sophomore center Elissa Cunane - the reigning ACC player of the week - never got going against Janelle Bailey inside and finished with a season-low eight points on 3-for-11 shooting.
''North Carolina did a great job of attacking and taking it to us,'' Wolfpack coach Wes Moore said. ''I thought the second half we struggled to hit shots and felt like we probably needed to attack a little bit more than we did, maybe get the ball inside, maybe get to the rim some.''
N.C. State: The Wolfpack arrived alongside No. 1 Connecticut, No. 3 Oregon State and No. 8 UCLA as the nation's remaining unbeaten teams (UConn also lost to No. 6 Baylor on Thursday night). But after a hot start, N.C. State went completely cold and missed 12 straight shots as UNC climbed back in it.
UNC: The Tar Heels had won their first two league games under Banghart before losing last weekend at Virginia Tech. This one was huge, with the Tar Heels shooting 45% after halftime and hanging in when the Wolfpack pushed ahead by double figures before making their move with some big late baskets from Bennett.
The 6-foot-5 Cunane came in averaging 17.5 points and 10.4 rebounds with 54 points combined but was never much of a factor as the Wolfpack launched 29 3-pointers.
Moore said he wanted to get more post touches for Cunane, ''but on the other side of the coin, Bailey did a really good job on Elissa of bodying her up, being physical with her.''
Banghart said the plan was to leave Bailey, a 6-4 junior, largely on her own inside against Cunane.
''I'll take on the defensive challenge anytime coach gives it to me,'' Bailey said.
N.C. State: Notre Dame hosts the Wolfpack on Sunday.
UNC: The Tar Heels visit No. 11 Florida State on Sunday.
More AP women's basketball: https://apnews.com/Womenscollegebasketball and https://twitter.com/AP-Top25
Follow Aaron Beard on Twitter at http://www.twitter.com/aaronbeardap