A second-half rally led by Justin Holman wasn't enough to overcome a sluggish start by UCF.
Penn State defeated the Knights 26-24 on a last-second field goal by Penn State kicker Sam Ficken.
Holman took over the offense after halftime and led UCF on a comeback, after trailing 10-3 at halftime. Holman finished the game 9-for-14, 204 yards and a touchdown passing, and added two rushing scores.
With about a minute to go, Holman ran in a quarterback draw to give UCF a late 24-23 lead.
Penn State quarterback Christian Hackenberg set a school record for passing yards in a game, amassing 454 yards and a touchdown.
In the first half, Pete DiNovo, UCF's starting quarterback, completed 3-of-8 passes for 18 yards.
Because Will Stanback missed the game due to injury, Dontravious Wilson got the start at running back and gained 34 yards on 21 carries.
Holman took over in relief of DiNovo and found Breshad Perriman for a 50-yard pass that led to a UCF touchdown, and then later found Josh Reese for a long pass on fourth down that led to the go-ahead score.
Safety Clayton Geathers led the UCF defense with 15 tackles and had a fumble recovery.
UCF falls to 0-1 on the season and will return to the field against Missouri Sept. 13 at noon.