LOUISVILLE, Ky. -- Jameis Winston threw three touchdowns to offset a three-interception start and Dalvin Cook had two long scoring runs to help second-ranked Florida State rally for a 42-31 victory over Louisville on Thursday night.

Florida State overcame a 21-0 deficit for its 24th straight victory, with Cook giving the Seminoles the lead for good with a 38-yard run with 3:46 remaining.

Out of sorts and on the verge of having its College Football Playoff prospects damaged, the Seminoles (8-0, 5-0 Atlantic Coast Conference, No. 2 CFP) recovered behind their Heisman Trophy quarterback and Cook, who had a 40-yard touchdown run in the third quarter.

All of Winston's TD passes were big. He hit Travis Rudolph for 68 yards, Ermon Lane for 47, and Freddie Stevenson for the 35-yard clincher with 2:11 remaining.

Winston was 25 of 48 for 401 yards.

More important for the Seminoles was maintaining their national championship hopes on a night that Louisville (6-3, 4-3, No. 25 CFP) nearly took them away twice.

The presence of Muhammad Ali was fitting in a game that the Cardinals initially dominated with a smashmouth approach that provided a 21-point first-half lead and knocked the Seminoles on the ropes. Michael Dyer had TD runs of 4 and 12 yards and Gerald Christian caught an 11-yard scoring pass from Will Gardner.

Florida State began its comeback just before halftime when Winston, shaking off two interceptions that Louisville turned into 14 points, led the Seminoles 78 yards on a drive that ended weird touchdown when Nick O'Leary recovered Karlos Williams' fumble in the end zone.

The intermission gave Winston and Florida State time to regroup, though not before his third interception and second by Louisville safety Gerod Holliman. Ironically, Winston's biggest play came after the pickoff as he came up and stripped Holliman of the ball, which Travis Rudolph recovered at the Florida State 40.

The Seminoles turned it over on downs but Winston found Rudolph wide open down the middle between two defenders for a 68-yard TD strike that cut it to 24-14 with 9:51 left in the quarter.

Florida State's swagger was back, and Cook turned it into a 40-yard touchdown run nearly 4 minutes later to bring the Seminoles within a field goal.

Winston's TD pass to Lane with 12:48 left provided Florida State's first lead and the game became a slugfest from there as Dyer answered for Louisville with a 1-yard TD run with 9:20 left. The Seminoles took charge from there with Cook's TD run and Stevenson's pass from Winston.