UNIVERSITY PARK, Pa. — The Maryland football team started the season with three margins of victory of at least 27 points. The offense hit the 50-point mark twice. The defense suffocated Purdue’s offense in Week 4, while the Terps rushed for 400 yards in the homecoming blowout.

But coach DJ Durkin and his staff said this week the team’s early burst, while exciting with the program’s second 4-0 start since 2001, left room for improvement. After all, Maryland’s first four opponents combined for an 8-39 record in 2015. Penn State, which finished 7-6 a year ago, would present a tougher task, they said.

In front of 100,778 homecoming fans Saturday afternoon at Beaver Stadium, the Terps endured the test from their Big Ten East foe. Maryland trailed for the second time this season when the Nittany Lions powered down the field for a touchdown on the first drive. The Terps never held a lead in the 38-14 defeat, the first of Durkin’s tenure.

“They know they didn’t play very well, and they know they’re not feeling well about their performance,” Durkin said. “We got out of whack there at some point in that game and made some really costly, dumb mistakes.”

Penn State running back Saquon Barkley, who defensive coordinator Andy Buh said before the contest would be the best back the Terps had faced this season, gashed the defense for 202 yards on 31 carries. Penn State totaled 372 rushing yards while Maryland had 170.

Nittany Lions quarterback Trace McSorley, meanwhile, completed 10 of his 19 passes for 152 yards and two touchdowns. He also rushed for 81 yards and a touchdown on 18 attempts.

Barkley helped Penn State build a gap the Terps couldn’t overcome when he scored with 15 seconds left in the first half to give Penn State a 24-14 lead.

The run came less than a minute after quarterback Tyrrell Pigrome took his first snap of the game seven yards into the end zone to reignite the team’s momentum. Quarterback Perry Hills kept the ball and ran four yards a play before, but when a scrum of Penn State defenders met him up the middle, the redshirt senior stayed down.

He walked slowly off the field with trainers moments later and missed the rest of the game with what Durkin confirmed was a shoulder injury, the same ailment he suffered from on the penultimate play of the Terps’ double-overtime victory against Central Florida on Sept. 17.

In that contest, Pigrome’s touchdown sealed the triumph. But Saturday, Barkley’s weaving 45-yard dash capped a three-play, 75-yard drive that widened Penn State’s advantage and left Durkin grimacing on the sideline with his hands on his hips.

“We do a good job of executing and getting down the field and scoring, thinking we’re going to go into half after a nice two-minute drive,” Durkin said. “Just really indescribable how we played the next series on defense. It really, really is.”

The rookie coach’s frustrations continued after the break. The Terps offense went three-and-out after linebacker Isaiah Davis clocked Penn State kicker Joey Julius on the kickoff, drawing a targeting foul and an ejection. Durkin met him on the field for a one-on-one conversation and continued to discipline the redshirt freshman as he left the field.

Then, McSorley led the Nittany Lions down the field, converting two third-down looks to enter the Terps’ red zone. On the second, the junior signal-caller weaved up field a for a 12-yard gain, and Durkin threw his fists down and hunched over.

Pigrome and the offense managed a seven-play, 62-yard drive after cornerback Will LIkely forced a fumble deep in the Terps’ territory, but Maryland faced a 4th-and-2 at Penn State’s 22-yard line. After taking a timeout, freshman running back Jake Funk took an inside handoff and ran toward the right sideline. Nittany Lions safety Marcus Allen, who notched 22 tackles in Penn State’s overtime win against Minnesota last weekend, dropped him for a five-yard loss.

“I believe we could have came back and still put points on after that stop,” running back Ty Johnson said. “Their defense just read it well and made the tackle.”

About four minutes later, McSorley unleashed a deep ball down the right sideline to wide receiver DeAndre Thompkins for a 70-yard touchdown as the third-quarter clock expired.

The connection highlighted the Nittany Lions’ dominance on offense. Coach James Franklin’s squad posted 524 yards to the Terps’ 270, delivering Durkin’s bunch a test it couldn’t withstand.

“Every game is its own entity,” linebacker Jermaine Carter said. “You can’t go into a game thinking you’re going to win just because you won the last one.”