PITTSBURGH — Wide receiver Aaron Matthews hit quarterback Kenny Pickett on a 3-yard, fourth-down touchdown pass with 56 seconds remaining and Pittsburgh stunned No. 15 UCF 35-34 on Saturday.

The Panthers (2-2) ended UCF’s 25-game regular-season winning streak on a play head coach Pat Narduzzi called the “Pitt Special” in a nod to the Philadelphia Eagles, who ran a similar play two seasons ago in their Super Bowl victory over the New England Patriots.

Pitt trailed by six when Pickett drove the Panthers to the UCF 3. Running back A.J. Davis took a direct snap with Pickett going in motion. Davis handed the ball to Matthews, who rolled to his right and hit Pickett in the end zone. UCF’s last-gasp drive went nowhere.

Pickett completed 25 of 47 for 224 yards with a touchdown despite leaving briefly with a right arm injury. Maurice Ffrench and Dontavius Butler-Jenkins caught touchdown passes for the Panthers, who bounced back from an emotional loss to rival Penn State last week by withstanding a 31-point outburst from the Knights (3-1) in the middle of the game.

UCF quarterback Gabriel Dillon passed for 338 yards and two touchdowns but also threw his first two interceptions of the season. Gabriel Davis hauled in 10 passe for 151 yards and two scores, but the Knight’s high-tempo offense didn’t run as efficiently as it had during three blowouts to start the year.

UCF finished with 423 yards, 180 under its season average.

The Panthers reeled off the game’s first 21 points, including an 18-yard blocked punt return for a touchdown midway through the second quarter. Trailing by three touchdowns for the first time since a blowout loss to Michigan in 2016, UCF responded emphatically, with a little help from the Panthers.

Pitt running back A.J. Davis fumbled deep in Panther territory with 5:41 left in the first half. Adrian Killins scored four plays later and UCF was off and running.

Gabriel found Gabe Davis for two third-quarter touchdowns. Those touchdowns were sandwiched around an 87-yard punt return for a score by Otis Anderson, who broke several tackles while racing down the left sideline to the end zone.

Gabriel’s 28-yard rainbow to Davis gave UCF 31 points in less than a quarter. Pitt backup quarterback Nick Patti’s first career touchdown pass, a 6-yard toss to Butler-Jenkins, drew the Panthers within three late in the third quarter. The Panthers had a chance to tie it early in the fourth, but Alex Kessman’s 40-yard attempt sailed wide.

Gabriel led a long scoring drive — including a conversion on fourth-and-1 at the UCF 47 — that ended with a Dylan Barnas 28-yard field goal with 4:36 to go.

Pitt, which opted to attempt a field goal while down seven in the fourth quarter against Penn State last week, moved steadily down the field. And this time, the Panthers dialed up a play that gave them a victory that should provide their season with a massive jolt.