Ty Johnson gained 168 yards on 11 carries for Maryland. (Jonathan Newton/The Washington Post)

The Maryland football team finally was able to celebrate after four straight weeks of futility. A 31-13 win against lowly Rutgers on Saturday afternoon provided plenty of reason, with the Terrapins becoming bowl eligible in the final home game for the senior class.

Maryland (6-6, 3-6 Big Ten) opened a two-touchdown lead in the first quarter and Rutgers didn’t get within eight the rest of the game. Overall, Maryland clinched a fourth bowl berth in the past seven seasons. The Terrapins had lost to Indiana, third-ranked Michigan, No. 5 Ohio State and No. 18 Nebraska over the last month before dispatching the only team that is winless in Big Ten play.

“It means a lot,” said first-year Coach DJ Durkin, who had a bucket of water doused on him after the final whistle. “If we started the season 0-4 and then came on a tear, and we’re on a 4-0 streak going into this game, it would be the greatest thing going, but it didn’t happen that way. When you look at where we’ve come from, where we started, and what we’ve got, it’s a tremendous achievement for our guys.”

Sophomore tailback Ty Johnson led the way with 168 yards on 11 carries as part of a rushing attack that amassed 318 yards in front of an announced crowd of 30,220 at Maryland Stadium. The Terrapins had 414 yards of total offense in their first win since Oct. 22, when they defeated Michigan State, 28-17.

The defense contributed with seven sacks and a stand on fourth and eight late in the fourth quarter when the outcome remained somewhat in doubt. Linebacker Jermaine Carter Jr. (15 tackles, two sacks) got into the backfield on the play to sack quarterback Giovanni Rescigno for a 13-yard loss with 6:51 left in the game.

“I don’t think we ever lacked confidence,” said Carter, a junior. “We all have confidence in ourselves and our own ability. It’s just not always the right result that we want, but we had to step up and be better than what we’ve been. We’ve got a lot of young guys playing, and we had to put the extra time in. We knew we had to go out there and get the win for the seniors.”

The Terrapins, perhaps bound for the Quick Lane Bowl in Detroit on Dec. 26, extended their lead to 28-13 late in the third quarter on a one-yard dive from seldom-used senior running back Andrew Stefanelli. The graduate of Good Counsel High had not carried the ball in his career before scoring the touchdown.

Johnson got the possession going with a 47-yard run on first and 10 from the Maryland 25. Johnson gained 10 yards on the next snap of the five-play, 75-yard drive.

With Rutgers (2-10, 0-9) advancing into Maryland territory to start the second half, the Terrapins forced the game’s first turnover courtesy of Carter, who stripped the ball loose from tailback Justin Goodwin and gained control before hitting the ground. Goodwin had secured a 30-yard pass at the Maryland 10 just before Carter’s alert play with 11:51 left in the third quarter.

Goodwin made up for his gaffe shortly thereafter with a 28-yard touchdown run down the middle of the field to cap a six-play, 57-yard drive. Maryland’s Chandler Burkett blocked Michael Cintron’s point-after kick to keep the lead at 21-13 with 4:48 to play.

Backup quarterback Tyrrell Pigrome had expanded the Terrapins’ advantage to 21-7 via a 28-yard run with 5:09 to go until intermission. The freshman initially was looking to pass but took off running around the left side when he was unable to find an open receiver en route to the end zone. It was the third rushing touchdown this season for Pigrome.

Rutgers scored its first points since Nov. 5 on running back Robert Martin’s one-yard carry, trimming the deficit to 14-7 early in the second quarter. The junior’s second touchdown this season came with 10:44 left in the first half and during a drive in which the Scarlet Knights were set to punt on fourth and three. Maryland’s Alvin Hill, however, jumped offside before the snap, giving Rutgers a first down.

Two lengthy touchdowns allowed Maryland to accumulate more points in the game’s first 7:35 than it had in its previous three games combined.

The first came on a career-best 46-yard run by running back Kenny Goins Jr. The senior scored the fifth rushing touchdown of his career on a drive set up by D.J. Moore’s 35-yard return on the opening kickoff.

Another special teams touchdown followed when senior Teldrick Morgan returned a punt 83 yards. Morgan absorbed a jarring blow from Anthony Cioffi immediately after making the catch but was able to escape for Maryland’s first punt return touchdown since Sept. 12, 2015.

“It was very important” becoming bowl eligible, said fifth-year senior quarterback Perry Hills, who started despite two sore shoulders. With the team relying on the running game, he attempted only 15 passes, completing nine for 96 yards.

“Being the last year, just getting an extra game with the University if Maryland, it feels great.”