Maryland football quarterback Tyrrell Pigrome sat near midfield Saturday with less than a minute remaining against Indiana. Slowly, he took off his helmet and got to his feet.

Interim head coach Matt Canada watched on as Pigrome made his way to the sideline. Pigrome had played inspired football to that point, leading a comeback after replacing Kasim Hill when he went down with a knee injury in the second quarter. With Pigrome in the game, Maryland outscored Indiana, 26-13.

But to overcome the hole they dug with turnovers and penalties, the Terps needed one last score, trailing by two points with 2:32 remaining.

As the pocket collapsed around Pigrome near midfield, though, defensive lineman Kayton Samuels broke free, swatted the ball out from Pigrome’s grasp and ended Maryland’s chances. The Hoosiers fell on the football, kneeled three times and held off the Terps to win, 34-32.

“Knowing how close we were, … it’s extremely tough. And that’s the biggest thing, you have to sit with that,” linebacker Tre Watson said. “We didn’t do what we felt we could’ve done to win the game.”

During the first quarter Saturday, it seemed Maryland would have its sixth win sealed up far before the final minutes. Midway through the first period, Hill stepped up in the pocket on third-and-goal and fired a pass toward wide receiver Brian Cobbs, who was open in the back of the end zone. But the redshirt freshman’s throw sailed out of Cobbs’ reach, and despite dominating Indiana on the first two possessions Saturday, the Terps settled for their second field goal.

Maryland gained 169 yards in the first quarter while Indiana had 12. But the Terps managed just six points, leaving a door open for the Hoosiers — one they would emphatically take advantage of in the second quarter.

“We left some plays on the field,” Canada said. “Those are points you’ve got to make.”

Midway through the first quarter, Hill rolled to his right and was clocked as he threw. His pass, hovering in the air, found its way to wide receiver Jeshaun Jones, who reeled in the ball with a one-hand catch. But that attempt was one of four throws Hill completed before a second-quarter injury withdrew him from the game.

On Maryland’s third drive, wide receiver Dontay Demus was open across the middle on third down. Hill couldn’t connect, and the Terps punted.

That offered Indiana a way back into the contest. Two chunk plays — one a 35-yard catch and the other a 35-yard scramble from quarterback Peyton Ramsey, weaving his way through Maryland defenders — gave the Hoosiers a 7-6 lead despite the yardage and time of possession disparity.

Demus burned his defender with a double move early in the second quarter and had open field in front of him. But Hill badly underthrew Demus, and defensive back Jaylin Williams caught up to the ball and picked it off.

That turnover, the first of four for Maryland, allowed Indiana to separate itself. Ramsey, who entered with the second-best completion percentage in the Big Ten, found wide receiver Donavan Hale for a 37-yard touchdown pass. And after Hill and running back Tayon Fleet-Davis misplayed a handoff, gifting Indiana a fumble recovery at Maryland’s 36-yard line, the Hoosiers piled on their third straight touchdown.

“Myself and the defense feel that we should’ve done more,” Watson said. “We had a lead with only a couple minutes left.”

Two late scores from Maryland narrowed the halftime deficit to 21-15, and its rushing game looked strong throughout despite injuries. Ty Johnson, a game-time decision after missing last week’s game with a calf strain, left after five first-quarter carries. Javon Leake rushed for a third-quarter touchdown but left injured shortly after. Despite that, Anthony McFarland’s 210 rushing yards led Maryland to 353 on the ground.

And Pigrome led Maryland’s second-half resurgence, finishing 10-for-13 with 146 yards. Late in the fourth quarter, Jones reeled in a pass and battled through three defenders, reaching for the pylon and scoring, giving Maryland a 32-31 edge.

“As soon as he came in, he got everybody going,” McFarland said. “Pig had a hell of a game.”

But on the subsequent drive, Indiana quickly drove down the field and converted a 42-yard field goal, retaking the lead. The Hoosiers left more than two minutes on the clock, though, giving the Terps time for a game-winning drive. Pigrome looked poised, completing two passes that brought Maryland to midfield.

Finally, though, one turnover too many ended the Terps’ chances in Bloomington when Pigrome lost the football with 52 seconds remaining. And with Ohio State and Penn State to conclude the season, Maryland may have run out of next chances and will have to settle on what-ifs as the path to bowl eligibility takes a turn for the worse.

“Felt like we were going to win,” Canada said. “But we didn’t.”