Justin Jackson hit a tying jumper in the final minute, and then had a fast-break dunk to help fourth-seeded North Carolina edge the Crimson 67-65 on Thursday night.
The Tar Heels (25-11) wasted a 16-point lead in the second half and briefly trailed before Jackson came to the rescue.
Siyani Chambers' four-point play put 13th-seeded Harvard ahead 65-63 with 1:15 remaining. It was the only lead of the game for the Ivy League champions.
Jackson finished with 14 points and Marcus Paige had 10.
Chambers misfired on a pair of 3-pointers in the closing seconds, and the Crimson's final chance for victory - Wesley Saunders' shot from beyond the arc - bounced off the back of the rim.
Saunders led Harvard (22-8) with 26 points. Chambers had 13.
North Carolina lost six of 10 down the stretch, but has played considerably better in the postseason, beginning with three wins on the way to the championship game of the ACC Tournament, where the Tar Heels lost to Notre Dame.
Isiah Hicks played some key minutes in the first half with the Tar Heels, with the reserve making all four of his shots and grabbing three rebounds in the first 20 minutes. His three-point play restored a double-digit lead after Harvard trimmed what was once a 14-point deficit to 26-23.
North Carolina led 36-25 at halftime, and Jackson made a 3-pointer coming out of the break. It looked as if the Tar Heels might run away when they built a 16-point lead with under 17 minutes to go.
But the Crimson kept their poise and clawed back into the game.
Two free throws from Steve Moundou-Missi cut North Carolina's lead to one with 3:39 left. Paige gave the Tar Heels some breathing room with a 3-pointer, but Harvard refused to crack.
Saunders hit a jumper and, with the clock winding down and Harvard fans urging Chambers to stop dribbling and shoot, the junior guard made a 3 and was fouled.
Jackson answered on the other end with his jumper, and then scored the go-ahead basket with 22 seconds remaining after North Carolina rebounded Chambers' miss.
Harvard: The Crimson won their opening game in the tournament the past two years, upsetting New Mexico in 2013 and Cincinnati last season.
North Carolina: The Tar Heels, making their 46th appearance, improved to 111-43 in the NCAA Tournament. ... Coach Roy Williams is leading a team in the tourney for the 25th time.
North Carolina: Arkansas or Wofford on Saturday.