TALLAHASSEE, Fla. (AP) — Dalvin Cook was in doubt for Florida State's game against Miami for most of the week because of a hamstring injury. He ended up with the Seminoles' highest-rushing total ever in the in-state series.

Cook ran for 222 yards on 22 carries and once again scored the winning touchdown. His 23 yard run around the right end with 6:44 remaining gave the 12th-ranked Seminoles a 29-24 victory Saturday night.

"How much did he rush for tonight? 222? That's crazy. That's video game stats," said Roberto Aguayo, who had three field goals.

Cook, who also had three receptions for 47 yards, missed the first two days of practice but took the field Wednesday. Florida State coach Jimbo Fisher said he wasn't sure that Cook was going to be able to play until Friday when he didn't feel any lasting effects from a hard practice the day before.

"While I was warming up and felt great I knew it was a go," Cook said. "It was a great feeling and something you can't describe going out there and scoring the winning touchdown and watching the defense stop them."

Last year, the Miami native scored the go-ahead touchdown with 3:05 remaining. Before Cook's game, the previous high by a Florida State back against Miami was 189 yards by Greg Jones in 2002.

"This team gets challenged a lot of different ways. The offense stepped up," Florida State coach Jimbo Fisher said. "You saw Dalvin Cook one of the best backs in college football. There's something in him that's different. I'm glad he's on my team."

The Seminoles (5-0, 3-0 Atlantic Coast Conference) have won six in a row against the Hurricanes (3-2, 0-1), their longest winning streak in the series since winning seven straight from 1963-72.

Cook is the first Florida State back to have two 200-yard games in a season since Greg Allen in 1981. Before this year, the Seminoles had not had a back run for more than 200 yards in a game since Sammie Smith in 1988.

"He's a great back and we missed too many tackles on him and he got free in the open field," Miami coach Al Golden said. "The whole game plan was obviously to contain Cook. We let him out too many times and he made us pay on the second level."

Miami took a 24-23 lead on Brad Kaaya's 29-yard touchdown pass to Stacy Coley with 10:02 left. Florida State began the ensuing drive on its own 16 and nearly went three-and-out until Everett Golson completed a 20-yard pass to Jesus Wilson.

After that Cook took over as he got the ball on three of the next five plays, gaining 47 yards.

"That last drive, we had it going. Bobo (Wilson) made that great third down catch. He had that look in his eye on that third down," Cook said. "Bobo made a big block and I cut off his block"

According to STATS LLC, Cook's 792 yards after five games are the second-most in the ACC since 1996. Maryland's Bruce Perry had 821 yards in 2001.

Miami had one final chance to rally, but the drive stalled on its own 44 when Kaaya's pass intended for Herb Waters was incomplete. Kaaya was 29 for 49 for 405 yards and three touchdowns, the fifth 300-yard game of his career and his second against Florida State.

Coley had seven receptions for 139 yards and Rashawn Scott added six catches for 108 yards. The Hurricanes took advantage of a Florida State's short-handed secondary, especially after Jalen Marshall was ejected in the first quarter for targeting.

Florida State's Everett Golson completed 25 of 33 passes for 291 yards and a touchdown. Kermit Whitfield had nine receptions for 95 yards.

Cook opened the scoring on his first carry with a 72-yard run. It was the second straight week that Cook scored a touchdown on his first carry and was his third touchdown run this season of 70-plus yards.

After Michael Badgley's 30-yard field goal put Miami on the board, Cook extended the Seminoles' lead to 14-3 when he took Golson's screen pass 36 yards for a score.

Trailing 17-3, Miami got back into it on Kaaya's 58-yard touchdown pass to Scott, who was able to get separation from cornerback Jalen Ramsey while Lamarcus Brutus tried to go for the interception and missed.

After that, Miami was able to counter Aguayo's field goals with touchdowns. Joe Yearby's 1-yard reception brought them to 20-17 with 5:26 remaining in the third. After Aguayo's third field goal, Coley's touchdown gave the Hurricanes a short-lived lead.

"Despite going down early they stayed together and we had opportunities to win," Golden said. "We just needed to make one more play somewhere along the line. I believe in our guys. I believe in our leadership. We're not going away."