HUNTINGTON, W.Va. (AP) -Kevin Smith rushed for a season-high 166 yards before getting hurt and Michael Torres kicked a 22-yard field goal with 6.7 seconds left to lift UCF to a 23-22 victory over Marshall on Wednesday night.

Anthony Binswanger's career-high 50-yard field goal gave Marshall a 22-20 lead with 3 minutes left, but that left enough time for UCF quarterback Steven Moffett.

Moffett, who was benched for most of the first half, completed four straight passes to move the Golden Knights (2-3, 1-1 Conference USA) to the Marshall 17 with 50 seconds remaining. He finished 13-of-19 for 165 yards.

Jason Peters then ran 14 yards to the 3, setting up Torres' third field goal of the game, all from 22 yards.

Marshall (1-4, 0-1) couldn't take advantage of the 181-yard rushing effort of Ahmad Bradshaw and the energized atmosphere of having actor Matthew McConaughey on the sidelines.

McConaughey is starring in an upcoming film on the aftermath of a 1970 plane crash that killed 75 people, including most of the Marshall football team. He led the current team on a walk to the stadium before the game. A 4-minute scene from the film, scheduled to be released Dec. 22, was shown at halftime.

Smith's 34-yard run set up Moffett's 28-yard TD pass to Mike Walker to give UCF a 20-9 lead early in the third quarter. Smith suffered an undisclosed injury late in the third quarter and didn't return.

Bradshaw answered a minute later with a 32-yard TD run and Binswanger's 26-yard field goal early in the fourth brought Marshall within 20-19.

Marshall drove 99 yards for its first score, aided by Bradshaw's 59-yard run. Bernard Morris hit freshman tight end Cody Slate with a 7-yard TD pass for a 6-0 lead after the missed extra point.

Kyle Israel replaced Moffett on UCF's third series and scored on a 2-yard run to put the Golden Knights ahead 7-6 early in the second.