Something had to give as Maryland and Michigan State met with both Big Ten teams looking to snap losing streaks and keep bowl hopes alive.

The Terrapins (5-2, 2-2 Big Ten) snapped their two-game losing streak behind Perry Hills' 21-of-27 passing for 200 yards and a clinching touchdown in a 28-17 victory on Saturday night in College Park, Md.

Hills threw a 9-yard scoring pass to Levern Jacobs with 3:23 to complete the scoring after missing Maryland's last game with a shoulder injury.

Michigan State (2-5, 0-4) had to shoulder a fifth straight loss as its 2016 nightmare continued, losing the first four conference games for the first time since 1982.

The Spartans rushed for a season-high 270 yards, but the big plays went the Terrapins' way.

Maryland regained the lead with 13:49 to play when Kenneth Goins Jr. scored from 2 yards to make it 21-17. Ty Johnson's 44-yard run into Michigan State territory, part of his 115-yard night on nine rushes, set up the score.

Michael Geiger's 34-yard field goal put Michigan State ahead for the first time at 17-14 with 1:35 left in the third quarter. The Spartans moved the ball 48 yards entirely on the ground in 10 plays to take the lead.

Michigan State had gone 74 yards in 10 plays just before the half. Gerald Holmes scored from 1 yard with 38 seconds remaining to tie the score 14-14.

The Terrapins had scored first on Lorenzo Harrison's 8-yard run with 2:51 left in the first quarter on a drive aided by 35 yards of penalties against Michigan State, including a targeting personal foul penalty on senior linebacker Riley Bullough that resulted in his ejection.

The Terrapins made it 8-0 when Goins scored on an option pitch from holder Caleb Rowe for the two-point conversion.

Michigan State was flagged seven times for 84 yards.

Michigan State scored early in the second quarter. LJ Scott dashed 48 yards down the left sideline to make it 8-7. Scott finished with 128 yards rushing on 20 carries.

The Terrapins then got a 40-yard run from Johnson. Four plays later, Hills connected with a wide-open D.J. Moore behind the defense for a 36-yard touchdown. The PAT was no good.