Dominique Davis threw four touchdown passes, including a pair to Reese Wiggins, but it took a 56-yard touchdown run by Torrance Hunt with 2:10 left in the game for East Carolina to beat Central Florida 38-31 on Saturday night.
East Carolina (5-6, 4-3 Conference USA) broke a two-game losing streak and kept its bowl hopes alive. The Pirates finish their season at Marshall next Saturday.
UCF (4-7, 2-5) lost for the third straight time and was knocked out of bowl contention.
Davis finished 19 of 31 for 203 yards but was intercepted once. His four touchdown passes matched his season high set in East Carolina's season-opening loss to South Carolina. One of his scoring passes to Wiggins was for 84 yards, the fourth-longest in East Carolina history.
Davis also added a career-high 62 rushing yards on 12 carries.
UCF rallied from a 17-7 deficit early in the second quarter to knot the score at 24-24 with 1:32 left in the third on a 4-yard run by Latavius Murray.
After East Carolina went up 31-24 on Wiggins' second touchdown catch with 8:20 left in the game, the Knights tied the score again. Backup quarterback Blake Bortles hit J.J. Worton for a 19-yard touchdown pass with 3:49 left.
East Carolina's winning drive covered 68 yards, with Hunt breaking free up the middle and then dashing down the left sideline 56 yards for the touchdown - the longest rush of his career.