WEST LAFAYETTE, INDIANA — The Terrapins men’s basketball team had accomplished the near-impossible Saturday. In the span of 90 seconds, they had erased a 10-point deficit and tied the game at 76 with about two minutes remaining.

After the Terps trailed by as many as 16 during the first half, a rare road win over a ranked opponent was within reach. The Terps could break a streak of 18 consecutive losses on the road against top-25 teams, according to ESPN. Players and coaches alike were jumping for joy.

But the Terps let that golden opportunity slip through their grasp.

Rebounding has been an issue at times this season and was again a problem Saturday, especially in the final two minutes. The Terps were unable to secure a rebound late, which led to two crucial points for Purdue. That extra opportunity would prove the difference in the No. 10 Terps’ 83-79 loss to No. 20 Purdue at Mackey Arena. The Terps were outrebounded 41-22.

“Obviously the difference in the game is we couldn’t rebound,” coach Mark Turgeon said. “They could.”

With 2:12 left in the contest, forward Jake Layman tied the game on a layup, the first stalemate since it was 0-0. The Terps never led.

While Purdue center A.J. Hammons went 1-for-2 from the foul line, Terps freshman Diamond Stone lost the ball out of bounds on the next Terps’ possession. On the ensuing play, Purdue guard Johnny Hill drove to the basket for a layup.

After the Terps (23-6, 11-5 Big Ten) cut the deficit to 79-77 with a free throw, they forced a miss on the other end, but Hill got the rebound. Turgeon signaled for guard Melo Trimble to intentionally foul a Boilermaker, but 17 seconds ran off the clock before Layman committed a foul with 22 seconds left.

Purdue (22-7, 10-6) hit both free throws and would walk off the court victorious seconds later.

“A couple mistakes late,” said Layman, who was third on the team with 15 points. “Not fouling early was probably one of them.”

Trimble led the Terps with 19 points but was 4-for-12 from the field, including 2-for-7 on 3-pointers. It was the first time in the past six games the sophomore had more than three made baskets. Freshman center Diamond Stone was second with 18 points while Hammons led the Boilermakers with 19 points. He was one of five Purdue players who reached double figures.

Heading into Saturday, the Terps controlled their destiny in the Big Ten, and a conference title was within reach. But this defeat against the Boilermakers, the Terps’ third loss in four games, severely hurts the team’s chances.

Early it looked like the Boilermakers would cruise to a victory. Less than eight minutes into the game, the Terps trailed 24-8 as they failed to box out.

“We kind of dug ourselves too big of a hole,” Layman said.

The Terps worked on rebounding during the week, Turgeon said Friday, but that extra effort didn’t paid dividends against the Boilermakers, who are one of the few teams in college basketball that can match the Terps’ height with two 7-footers.

The Boilermakers had a 24-10 edge in second-chance points and nearly matched the Terps’ overall rebound total (22) with offensive rebounds (19).

“Rebounding, that’s just on us,” reserve guard Jared Nickens said. “We just have to want to do that, and we’ll get that corrected going forward.”

The Terps finally settled in when they fell behind by 16. They went on a 15-3 run over roughly the next six minutes to cut the deficit to 27-23.

But the Terps continued to struggle on defense and trailed 44-39 at halftime. The Boilermakers’ 44 points were the most the Terps have allowed in a first half all season and the third time in the last three games that the Terps have given up 40 points or more in a half.

For much of the second half, the Terps were within striking distance of Purdue. Even when they were down double digits with less than four minutes remaining, the Terps turned to their suffocating press and tied the game a minute and a half later.

In the end, though, the large deficits were too much for the Terps to overcome.

So when Layman reflected on the game outside the visiting team locker room in the bowels of Mackey Arena, he returned to the core problems Saturday: rebounding and the slow start.

“Our rebounding was so bad early,” Layman said. “Being down 24-8, it’s so hard to come back from that.”