EAST LANSING, Mich. (AP) Michigan State players came out to meet reporters after the game with green hats that said “PROGRAM WIN” on the back.

It’s a far cry from the Big Ten championships the Spartans played for earlier in the decade, but they were able to save face a bit by beating Maryland and becoming bowl eligible.

“I think it’s about a four-dollar hat,” coach Mark Dantonio said. “I just felt like, hey, need to have something to hang on to, point towards. They didn’t get the hats until Friday.”

Matt Coghlin kicked a 33-yard field goal with 2:14 remaining, and Michigan State beat Maryland 19-16 on Saturday. It was hardly an impressive performance for the Spartans against a Maryland team that had lost eight of its previous nine games, but Michigan State did just enough late. The Spartans drove 74 yards in 12 plays to set up the decisive kick by Coghlin, who also made a 32-yard field goal earlier in the final quarter.

The Terrapins (3-9, 1-8 Big Ten) still had a chance after Michigan State (6-6, 4-5) took the lead, but Josh Jackson’s pass toward Chigoziem Okonkwo fell incomplete on fourth down from the Maryland 47. Xavier Henderson was providing tight coverage on the play for the Spartans.

Brian Lewerke threw for 342 yards for Michigan State but was intercepted twice in the first quarter. The Spartans had all sorts of trouble against Maryland, which had lost each of its previous four games by at least 31 points.

But Michigan State has missed the postseason just once under Dantonio, and the Spartans were able to win in the last home game for Lewerke and some other seniors.

“Obviously things didn’t go well the past couple years, but there are still memories I look back and I’m very proud of,” Lewerke said. “I tried to get as many handshakes in on the field as I could before I walked off. I just tried to enjoy every second of walking off the field.”

The Terrapins took a 16-13 lead in the third quarter on a 63-yard touchdown run by Anthony McFarland Jr., but Michigan State kept them off the scoreboard after that. McFarland finished with 134 yards on eight carries.

“I just did what I could do, seeing holes and just try to execute, making the best out of my plays,” he said.

Each team turned the ball over twice in the first half, and the Spartans were also stopped on fourth-and-1 from the Maryland 4-yard line. Lewerke’s 1-yard scoring run with 3:08 left in the second quarter gave Michigan State a 13-7 lead at halftime.

Another crucial turnover came toward the end of the third quarter. Maryland was up 16-13 and driving when Jackson lost the ball and Michigan State recovered at its own 27.

RARE FG

Maryland’s Joseph Petrino kicked a 33-yard field goal in the third quarter, just the second made field goal for the Terrapins this season. He later had an extra point blocked.

QUOTABLE

Dantonio said he did something similar with the hats in 2012, when Michigan State also won its last regular-season game to make it to a bowl.

“We got it done in ’12, and I thought that this was a must-win for our football team and our program, just to get back to .500,” he said. “It’s not been an especially enjoyable year, but it’s been enjoyable being around our football team and our players.”

THE TAKEAWAY

Maryland: This was certainly more competitive than Maryland had looked for much of this season, but aside from McFarland, the Terrapins offered little offensively. They scored 142 points in their first two games of the season and 161 in the final 10.

“There’s no doubt that we still have a lot of work to do,” coach Michael Locksley said. “We closed the chapter to this season and look forward to getting this thing fixed and heading in the right direction. We won��t shy away from the work.”

Michigan State: Dantonio said this week that becoming bowl eligible was basically the minimum standard for his team, and this win felt like that. It was a lot tougher than it needed to be.

UP NEXT

Maryland: The Terrapins’ season is over.

Michigan State: The Spartans await a bowl bid.

---

More AP college football: http://apnews.com/tag/Collegefootball and http://www.twitter.com/AP-Top25

Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.