COLLEGE PARK, Md. (AP) — Payne Durham made two big catches during a wild fourth quarter — and this time, it was Purdue’s opponent that couldn’t stop committing crucial penalties.

Durham caught a 4-yard touchdown touchdown pass from Aidan O’Connell with 3:19 remaining, and the Boilermakers held on for a 31-29 victory Saturday when Maryland was flagged for an ineligible man downfield on what would have been a tying 2-point conversion with 35 seconds left.

Durham had seven catches for 109 yards, including a 56-yard catch-and-run that set up another Purdue touchdown late in the game.

“One thing about Payne, he’s a great leader,” Purdue coach Jeff Brohm said. “He’s made a few mistakes this year, he’d be the first one to tell you, but man, he goes hard. He cares, he wants to win, he’s a great teammate.”

Durham caught a late touchdown pass at Syracuse last month, but was called for a 15-yard penalty on the extra point — the start of a flag-filled meltdown that cost Purdue the game. But Maryland (4-2, 1-2 Big Ten) has had problems with penalties this year as well, and those were on full display Saturday.

The two teams went scoreless in the second half until a wild finish that included four touchdowns in the final 7:47. Maryland appeared to have tied it when Taulia Tagovailoa found Rakim Jarrett in the corner of the end zone for a 2-point conversion in the final minute. However, offensive lineman Delmar Glaze was flagged for being downfield, and Tagovailoa threw incomplete on the next attempt.

O’Connell threw for 360 yards and two touchdowns for the Boilermakers (4-2, 2-1). Tagovailoa threw for 315 yards and three touchdowns, but Maryland couldn’t produce any points off Purdue’s three second-half turnovers.

The Terrapins finally broke a 17-all tie on Tagovailoa’s 11-yard TD pass to Roman Hemby, but Cam Allen blocked the extra point. Maryland fans howled in protest as replays showed Allen may have jumped offside on the play.

“I’ll say this: The blocked extra point had a major impact on the game. It’s a one-score game, it takes us into overtime, it adjusts and changes how they play the game,” Terrapins coach Michael Locksley said. “The illegal man downfield had no impact on the touchdown, so I’ll just leave it at that.”

O’Connell, who had fumbled and thrown an interception earlier in the half, calmly guided the Boilermakers 66 yards in 10 plays and threw his 4-yard touchdown pass to Durham to put Purdue ahead 24-23. The Boilermakers then forced a Maryland punt with 2:36 left, and although the Terrapins had all three timeouts left, they left Durham all alone over the middle for his long reception that put the ball at the Maryland 2. That set up Devin Mockobee’s 1-yard touchdown run with 1:20 left that made it 31-23.

Tagovailoa and the Terps responded impressively, pulling within two on an 18-yard scoring pass to Corey Dyches, but Maryland ultimately came up one play short.

Tagovailoa opened the scoring in the first quarter with a 9-yard run, but Purdue eventually took a 10-7 lead with the help of a Maryland penalty. The Terrapins were called for an illegal substitution when O’Connell threw incomplete on third-and-goal from the 2. Given another chance, the Boilermakers scored on Dylan Downing’s 1-yard run.

O’Connell threw a 4-yard touchdown pass to Mershawn Rice for a 17-10 lead. That drive was aided by an unnecessary roughness penalty on Maryland’s Ahmad McCullough when Purdue would have been facing third-and-long.

Purdue took over the ball at its own 16 with 1:08 left in the half and seemed content to run the ball, but Maryland aggressively used timeouts and forced a punt. Then Tagovailoa found Dyches open behind the defense on a deep pass, and although defensive back Cory Trice caught him around the 15, he couldn’t bring him down.

The Maryland tight end eventually dragged the defender to the end zone for a 68-yard touchdown. That tied it at 17 with 14 seconds left in the half.

THE TAKEAWAY

Purdue: The Big Ten West is very much up for grabs, and this was a second straight win on the road for the Boilermakers after they also beat Minnesota. They were fortunate the turnovers didn’t come back to haunt them.

“It’s a credit again to our defense for keeping us in the game so long against a really good offense,” O’Connell said. “Two weeks in a row, they’ve basically won the game for us.”

Maryland: A missed opportunity to put it mildly. With a manageable October schedule, it wasn’t crazy to think Maryland could be 7-1 by the end of the month. The Terps had a decent crowd on a nice day in College Park — and an opponent that kept giving them the ball — but Maryland’s offense didn’t start clicking until the very end.

“Are we disappointed? Yeah, we sure are because we let one slip away here at home,” Locksley said. “It’s just critical we come away with some points when we get turnovers like that.”

KEPT UNDER CONTROL

This game included a couple of the Big Ten’s best receivers, but Purdue’s Charlie Jones had only three catches for 15 yards, and Jarrett had four catches for 28.

UP NEXT

Purdue: The Boilermakers return home to face Nebraska next Saturday night.

Maryland: The Terrapins are at Indiana on Saturday.