MIAMI GARDENS, Fla. (AP) At Miami, this will be The Comeback.

At Florida State, this will be The Collapse.

N'Kosi Perry threw four touchdown passes, and No. 17 Miami pulled off its biggest comeback ever against Florida State by rallying from 20 points down midway through the second half to top the Seminoles 28-27 on Saturday night.

''I never doubted,'' Miami safety Jaquan Johnson said.

There were few who could say that.

The game had the usual fare that comes with this rivalry: A pregame shout fest after warmups, the entire Miami roster getting an unsportsmanlike conduct penalty for running across the field to come to the aid of injured receiver Jeff Thomas after he got pulled down by his face mask and was shaken up near a raucous Florida State sideline, and missed field goals by both teams in the final quarter.

But what Miami did in the final 20 minutes, that was most unusual.

The Hurricanes, down 27-7, scored two touchdowns in a span of 42 seconds to get right back into the game, and then Perry connected with Brevin Jordan with 11:52 left for what became the winning score - the one that would give Miami (5-1, 2-0 Atlantic Coast Conference) its first home victory over FSU since 2004.

''No one gave in,'' Miami coach Mark Richt said. ''No one gave up,''

Perry's numbers weren't great - 13 for 32, 204 yards - but he made big throws when they mattered. The go-ahead score to Jordan came one play after Perry threaded a 32-yard throw to Thomas on third-and-10, meaning in the span of about a half-minute the Hurricanes went 73 yards for the lead.

''I'm happy people are going to talk about that down the road,'' Perry said. ''But right now, it's just another game that we won.''

Deondre Francois completed 15 of 30 passes for 129 yards with two touchdowns and an interception for the Seminoles (3-3, 1-3), who were held to 200 yards of offense. He's 2-1 in three starts at Hard Rock Stadium, all three games being one-pointers.

''We didn't get what we wanted, which was a win,'' Florida State coach Willie Taggart said. ''This one's going to hurt for a while.''

The Seminoles had a fourth-quarter touchdown off a double pass taken off the board when officials ruled that the first throw from Francois to D.J. Matthews was forward, and negated Matthews' throw to Keith Gavin for a score that would have put Florida State up by two touchdowns.

''I thought it was good,'' Taggart said.

For the first 40 minutes, everything Florida State did was good.

Matthews tiptoed down the left sideline early in the third quarter for a 74-yard punt return touchdown, putting Florida State up 27-7. And the Hurricanes got booed off the field on their ensuing possession, the volume of those jeers rising when a draw play got called on third-and-16 as a prelude to a punt.

''Florida State came in here and took control of this game,'' Richt said. ''We found a way to fight back ... somehow, we gutted it out.''

Miami striker Derrick Smith got ejected for targeting, and one play later, the Turnover Chain appeared and the game turned. Gerald Willis III picked up a fumble to set up a 20-yard drive where Perry connected with Darrell Langham on a fourth-down throw for a touchdown. Francois was intercepted by Miami's Michael Pinckney two plays later, and the Hurricanes cashed in on their next snap when Perry and Thomas hooked up for a 17-yard score.

Just like that, 27-7 became 27-21. And when Ricky Aguayo missed 43-yard field goal with 12:42 left, the Hurricanes were still within one score.

The ensuring drive was when Perry went to Thomas on third down, Jordan one play later, and after a more than four-hour game - and 14 years - Miami could finally celebrate beating FSU at home.

''It just took a spark,'' Richt said. ''And before you knew it, that spark turned into a flame.''

THE TAKEAWAY

Florida State: FSU gets to ruminate on this collapse over its bye week, and has Wake Forest, Clemson, North Carolina State, Notre Dame, Boston College and Florida left on its regular-season slate. Becoming bowl-eligible won't be easy.

Miami: The Hurricanes hadn't beaten Florida State in consecutive seasons since 2003 and 2004, and still control their destiny in the ACC Coastal Division race. They'll be without Smith for the first half of next week's game at Virginia.

POLL IMPLICATIONS

The Hurricanes' 23-week streak - the ninth-longest active run in the country - will continue. Florida State will remain unranked.

HALFTIME LEADS

Advice to Miami and Florida State: In 2020, trail your rival at halftime. Each of the last three FSU-at-Miami games have seen somebody waste a double-digit lead at the half - Florida State by 13 on Saturday, Miami by 10 in 2016, Miami by 13 in 2014.

FIRST-TIMERS

Perry became the fourth consecutive QBs to win his initial FSU-Miami start, joining Miami's Malik Rosier in 2017, Francois in 2016 and FSU's Everett Golson in 2015.

UP NEXT

Florida State: Host Wake Forest on Oct. 20

Miami: At Virginia on Oct. 13

---

More AP college football: https://apnews.com/tag/Collegefootball and https://twitter.com/AP-Top25

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.