It was the first field goal make by either team after their respective kickers missed their first four attempts. Weiler also atoned for a blocked extra point that allowed the Seminoles to take a late lead.
"I knew it was within his distance. That wasn't the issue," North Carolina coach Larry Fedora said. "He had something to prove. After the extra point got blocked I talked to him on the sideline and said he had to get it out of his head. He got his mind right and we gave him his shot."
After Florida State took a 35-34 lead with 22 seconds remaining on a Deondre Francois 2-yard touchdown run, the Tar Heels were able to drive 38 yards in three plays. They also took advantage of a pass interference call on Florida State's Tavarus McFadden to get them in range.
It is the second straight week that the Tar Heels (4-1, 2-0 Atlantic Coast Conference) have won in the final seconds. Last Saturday, they defeated Pittsburgh 37-36 with two seconds remaining on a Mitch Trubinsky touchdown pass.
Against Florida State, Trubisky had his third straight 400-yard game, completing 31 of 38 passes for 405 yards and three touchdowns. Ryan Switzer, who had 16 catches last week, had 14 receptions for 158 yards.
The Tar Heels took a 34-28 lead on a 34-yard touchdown reception by Thomas Jackson, but Florida State's Wally Aime blocked Weiler's point-after attempt. Florida State (3-2, 0-2) then drove 75 yards in nine plays, culminating in Francois' score. The freshman quarterback looked like he was going to be sacked at the North Carolina 8 but eluded tackles by Mikey Bart and Malik Carney to score.
Dalvin Cook accounted for 256 yards of total offense - 140 yards rushing and 106 receiving - along with three touchdowns. It marks the first time he had gone over 100 yards rushing and receiving in the same game. Francois was 20 of 32 for 372 yards.
Florida State had the nation's longest active home winning streak. It is the Seminoles first home loss since falling to Florida in 2011.
"We had some critical mistakes in games, didn't finish drives early in games. Had some penalties," Florida State coach Jimbo Fisher said. "We have to play better. We have to do better. In all three phases. There's a lot of good there. There's way too much bad."
Florida State will fall from No. 12 . It's hard seeing the Seminoles fall out of the poll but how much will the voters take a second loss into account where their defense struggled. North Carolina fell out of the rankings after losing its opener to Georgia but this win could put them back in the Top 25.
North Carolina: After opening losses to South Carolina and Georgia the past two seasons, the Tar Heels finally have the big win over a ranked team that they have sought. Trubisky and Switzer are also emerging as one of the top quarterback-receiver duos in the ACC.
Florida State: The Seminoles are now 7-5 in their last 12 games dating back to last season. Even more concerning is that they are .500 (5-5) against Football Bowl Subdivision teams. Florida State was considered to be a College Football Playoff contender at the beginning of the season but now needs to string some victories together if it even hopes to make a New Year's Six bowl game.
North Carolina's Elijah Hood, who had 47 yards on 13 carries and a touchdown, was injured during the second quarter and was not on the sidelines during the second half. North Carolina did not disclose the nature of the injury.
North Carolina: The Tar Heels host Virginia Tech, who they defeated 30-27 in overtime last season to clinch the Coastal Division title.
Florida State: The Seminoles travel to Miami looking to extend their winning streak over the Hurricanes to seven.