LINCOLN, Neb. — Nebraska appeared ready to blow out Penn State, then suddenly found itself in a close game, the kind the Cornhuskers have been known to lose under third-year coach Scott Frost.

The Nittany Lions twice drove deep into Nebraska territory in the final 4 minutes, and each time the Huskers' defense made stops that preserved a 30-23 win Saturday.

"The state needed it, the team needed it, I needed it," Frost said. "We talked at halftime, and I talked to them frankly, that we've been in this situation before. You need to learn how to win. Winning will help the kids know they can win going forward."

Luke McCaffrey made his first start at quarterback in place of Adrian Martinez, who turned in two flat performances as the Huskers opened the season with two losses.

"That decision is one of the hardest decisions I've ever made," Nebraska coach Scott Frost said. "I think so much of Adrian Martinez as a person. He's been through a lot with us. He certainly practiced well enough to play so it was a tough decision. I thought considering it was (Luke's) first start he did a lot of good things and there's a lot there to build on."

The little brother of NFL star Christian McCaffrey had a hand in two touchdowns in the first half. The Huskers (1-2, 1-2 Big Ten) lost their rhythm after that, managing just 95 yards and three points the rest of the way. He was 13 of 21 for 152 yards and he ran 13 times for 67.

"There's a comfort level that was grown throughout the game, so that's something huge going into next week," McCaffrey said. "That's definitely the most valuable thing taken from this game, and most important we got a win."

A Top 10 team to start the season, the Lions (0-4, 0-4) are off to their worst start since Joe Paterno's 2001 team also opened with four straight losses.

Quarterback Sean Clifford struggled again, getting replaced by Will Levis after turning over the ball on two the Lions' first three possessions.

"This year, obviously, we're not making enough plays and the turnovers, it's been challenging to overcome," Lions coach James Franklin said. "This year, with the results, it magnifies everything."

Nebraska led 27-6 at half, but the Lions pulled within a touchdown and had two chances to tie or go ahead in the final 4 minutes.

The Lions turned the ball over on downs after Levis threw four straight incompletions from the 11-yard line. Nebraska went three-and-out, and Levis moved his team to the 9. He threw in desperation under pressure from Ben Stille on fourth down, the ball hit the turf and the Huskers ran out the clock.

"I went in there and executed but it just wasn't enough," Levis said. "There's room for improvement all across the board, especially in the red zone. It means nothing if you get the ball all the way down there and then don't score."

Franklin sidestepped talk about the quarterback situation. Levis was 14 of 31 for 219 yards and ran 18 times for 61 yards.

"He went in and gave us a spark," Franklin said. "He made plays in the passing game, I thought he did a good job managing the game overall. It gives us something to build on for sure."

THE TAKEAWAY

Penn State: The Lions out-yarded the Huskers 501-298, but turnovers continue to plague them and they're staring at the possibility of an 0-5 start for the first time since the program started in 1887.

Nebraska: McCaffrey capitalized on his opportunity. He brings a spark to the offense, is always a threat to run and on one play showed quite the flair with a left-handed pass when he was about to be sacked.

LONG DAY OF WORK

Penn State had possession for over 36 minutes, leaving Nebraska's defense on the field for 91 plays.

""I'd say toward the end of the game it took a toll on us," said cornerback Cam Taylor-Britt, who had a 55-yard interception return. "Once they called their timeouts, we got just a sip of water, that's all we need. We wanted to be the ones to finish the game off and we did that."

ROBINSON'S ROLE

Frost planned to get the explosive Wan'Dale Robinson more involved in the offense, but he didn't expect it to be with him playing running back. Robinson, who mostly plays receiver, replaced an injured Dedrick Mills and carried 16 times for 60 yards. He also caught five balls for 11 yards.

UP NEXT

Penn State hosts Iowa on Nov. 21. The Nittany Lions have beaten the Hawkeyes six straight times.

Nebraska hosts Illinois on Nov. 21. The Huskers are 6-1 against the Illini since joining the Big Ten.