Maryland running back Justus Pickett scampers across the goal line as the Terps barely avoid a humiliating defeat against William & Mary of the Football Championship Subdivision (formerly I-AA). (Doug Kapustin/For The Washington Post)

The Maryland football team averted what would have been a disheartening result thanks to a late touchdown and a mostly stout defense, coming back for a 7-6 victory over William & Mary on Saturday afternoon before 31,321 at Byrd Stadium, the smallest announced crowd for a Terrapins season opener since 1997.

The Terrapins trailed 6-0 for three-plus quarters, but sophomore tailback Justus Pickett’s six-yard scoring run with 9 minutes 52 seconds to play capped a 10-play drive covering 69 yards, and Maryland ensured it wouldn’t be shut out for the first time since 2008, and that it wouldn’t come against a team from the lower-level Football Championship Subdivision.

Apart from the touchdown, the decisive moment of the series came when wide receiver Kevin Dorsey took a screen pass on third and eight, broke a tackle and turned it into a 22-yard gain. Left guard Bennett Fulper contributed a crushing block to help spring Dorsey to the William & Mary 14-yard line.

“They very easily could have folded their tents, but they kept persevering, fighting and clawing, and they found a way to win,” Coach Randy Edsall said. “To overcome all of the adversity that we had in that game is a great credit to our players.”

The miscues began with quarterback Perry Hills, who was making the first start of his college career. The freshman threw three interceptions while completing 16 of 24 passes for 145 yards. Midway through the second quarter, Hills also missed high to tight end Devonte Campbell, who was wide open in the end zone.

That Maryland survived despite four turnovers — freshman running back Albert Reid lost a first-quarter fumble, as well — was a testament to the defense, which remained rigid in spite of being placed in precarious positions protecting a short field.

On William & Mary’s final stand, Maryland cornerback Jeremiah Johnson sacked backup quarterback Raphael Ortiz on fourth and three for a 19-yard loss and linebacker Demetrius Hartsfield recovered the corresponding fumble with 1:11 to play.

The Tribe compiled 229 yards of offense and just 88 in the first half, when it scored all its points courtesy of two field goals from Drake Kuhn. But Kuhn missed from 48 yards on the first snap of the fourth quarter, allowing Maryland to stay within one possession.

“There’s definitely the adrenaline that always happens during a game,” Hills said. “But as the game went on, everyone started settling down, starting doing some good things.”

The first series of Hills’s college career was derailed when his pass on second down was tipped and wound up in the arms of Tribe cornerback DeAndre Houston-Carson. Tight end Matt Furstenburg was the intended target, but the ball never made it through congestion at the line after the senior turned and set up to receive the throw.

William & Mary took over at the Maryland 34 and, six plays later, Kuhn’s 30-yard field goal provided a 3-0 lead with 11:35 to play. The Terrapins gave up 15 yards on the series when cornerback Dexter McDougle was assessed the first of three pass interference penalties, but the defense held running back Keith McBride to two yards on third and five to force the short field goal attempt.

During Maryland’s third series, Hills began by completing a slant and a quick-hitter inside for a first down and appeared recovered from his initial turnover. But later on the drive, Hills moved out of the pocket to his right to flee pressure and delivered a weak throw that safety Brian Thompson intercepted at the Maryland 41.

Thompson had open field in front of him and quickly made his way down the left sideline toward the end zone. Sophomore Marcus Leak had the angle, though, and was able to prevent the touchdown with a saving tackle at the 9.

From there, the defense dropped tailback Mikal Abdul-Saboor for a loss of two yards and escaped when quarterback Brent Caprio overthrew Nolan Kearney in the right corner of the end zone after the tight end ran behind the secondary.

Kuhn booted his second field goal, this one from 22 yards, and the Tribe extended its lead to 6-0 with 2:56 to play in the quarter.

Maryland committed its third turnover of the first quarter when Reid fumbled following a jarring hit from safety Jerome Couplin. Reid not only lost the ball but also three yards on the play, and defensive end Stephen Sinnott recovered at the Tribe 39.

“In the first quarter you wanted to come out and explode early, kind of get that momentum early, get the drives going,” Dorsey said. “But to have turnovers, fumbles and everything, it kind of puts you down a little bit, but just seeing the guys keep their heads up and push through, I mean it wasn’t a pretty one, but at the end of the day it’s still a win.”