McAdoo hit a free throw with 3.5 seconds left, then grabbed his own rebound after a miss to lift the No. 6-seeded Tar Heels to a 79-77 victory over No. 11 seed Providence in a second-round East Region NCAA tournament game on Friday.
Cotton scored 36 points and had eight assists as he and the Friars pushed North Carolina to the brink.
But Tar Heels guard Marcus Paige hit a critical 3-pointer to tie it at 77-77 with 1:10 left, setting up McAdoo's last-second heroics.
McAdoo hit the first of two free throws to put the Tar Heels ahead by a point with 3.5 seconds left. After he missed the second, he got the rebound and was fouled again. He hit another free throw and missed the second to set the final score.
North Carolina coach Roy Williams had never lost an NCAA Tournament opener entering this year's tourney. He had won at least one game in each of his 23 tournament appearances as a head coach at North Carolina and Kansas.
That record stayed intact, but just barely.
McAdoo scored 16 points and grabbed 10 rebounds and forward Brice Johnson added 16 points for the Tar Heels.
Cotton scored eight points, going to the basket for a trio of phenomenal layups, to lead the Friars on a 13-4 run midway through the second half. Cotton's jumper with 8:18 left gave Providence a 60-58 lead, its first lead since early in the first half.
However, Johnson stopped the run with a pair of free throws and had a tip-in to steady North Carolina.
North Carolina began to gain some separation late in the first half.
Tar Heels forward J.P. Tokoto stole a pass from Providence guard Josh Fortune, then spun away from on the fast break and threw down a dunk to boost North Carolina to its largest lead of the first half at 37-30.
But Cotton, who finished the first half with 13 points, dug in to score the final four points of the half and cut the Tar Heels' lead to three at the break.
North Carolina benefited from 11 second-chance points and scored 24 points in the paint on the way to a 39-36 halftime lead. North Carolina forwards Kennedy Meeks and McAdoo each had eight points to lead the Tar Heels in the first half.