SAN DIEGO (AP) — The Nebraska Cornhuskers almost got a farewell win for the seniors and interim coach Barney Cotton.

The No. 25 Cornhuskers erased most of an 18-point, third-quarter deficit before losing 45-42 to No 24 Southern California in the Holiday Bowl on Saturday night.

"It was emotional," said junior quarterback Tommy Armstrong Jr. "It's the last time we get to play with the seniors and the last time playing for some coaches. I'm happy to be able to play for those coaches last game, but to come up short, I know those guys are proud of us."

The Cornhuskers had a final shot from midfield by Armstrong's desperation pass was knocked down inside the 10 as time expired.

"I'm proud of these guys, proud of the team. They played hard and went out the right way," Armstrong said. "In a close game, you have to respond and show up and do things the right way. I think that's what I did that after the second quarter."

Nebraska fired Bo Pelini on Nov. 30. New coach Mike Riley watched from a skybox.

Armstrong completed 32 of 51 passes for 381 yards and three TDs, with one interception.

Armstrong brought the Huskers back with a 65-yard touchdown pass to Jordan Westerkamp with 24 seconds left in the third quarter and then a 15-yard keeper with 6:52 left in the game. His 2-point conversion pass to Kenny Bell pulled Nebraska to 45-42.

USC held De'Mornay Pierson to a 1-yard gain on a pass from Armstrong on fourth-and-3 from the USC 31 with 2 1/2 minutes left.

"The idea was we were going to go for it because we were just outside the envelop for our kicker," Cotton said. "I'm glad that we had the opportunity to go for it at the end. We were probably 3 or 4 yards beyond where we needed to be for our kicker."

USC's Adoree' Jackson scored on a 98-yard kickoff return and a 71-yard pass from Cody Kessler. Kessler completed 23 of 39 yards for 321 yards and three touchdowns for USC (9-4), which was playing Nebraska (9-4) in a bowl game for the first time.

"We've been through a lot this year," Southern California coach Steve coach Sarkisian said. "We've had a couple of just excruciating losses, and to come out tonight and win at the very end, we always try to make it exciting. We make it entertaining for everybody."

Kessler tied the USC single-season record of 39 touchdown passes set by Matt Barkley in 2011.

The Trojans took a 45-27 lead after Kessler threw a 20-yard scoring pass to Bryce Dixon with 2:03 left in the third quarter.

USC had 515 yards of total offense and Nebraska finished with 525.

USC's Javorius Allen gained 152 yards on 26 carries and scored on runs of 2 and 44 yards.

After Nebraska's Drew Brown kicked a 34-yard field goal early in the first quarter, Jackson caught the kickoff at the 2 and ran it up the right sideline for the longest kickoff return in Holiday Bowl history.

His 71-yard TD on a catch-and-run came on the first play from scrimmage after Nebraska punted on its first possession of the second half. He caught a short pass from Kessler and weaved through defenders to give USC a 31-17 lead.