COLLEGE PARK, Maryland — Poised to pull off the upset, No. 18 Purdue veered off course at the worst possible time.
A.J. Hammons and the Boilermakers gave No. 4 Maryland all it could handle for 34 minutes, but the Terrapins took control down the stretch and pulled out a 72-61 victory Saturday.
Purdue led 51-47 before Robert Carter Jr. hit a 3-pointer to spark a 9-0 run that put Maryland ahead for good.
A three-point play by Rasheed Sulaimon with 1:23 to go made it 61-53, at which point the raucous sellout crowd of 17,950 could finally relax.
Outscored 25-10 over the final six minutes, the Boilermakers lamented their inability to deliver when it mattered most.
"We stuck in it the whole game, but it was just closing the game that we needed to work on," said Hammons, who had 18 points and 10 rebounds.
Although this has been a banner season for the Boilermakers (19-5, 7-4 Big Ten), they now have lost 12 straight against top-five teams on the road since March 1994.
"When you're on the road you've got to be better than we were," coach Matt Painter said. "We had an opportunity to win the game and we weren't really good in the last seven, eight minutes."
Purdue went 3 for 25 from beyond the arc and lost for the first time in 10 games when Hammons leads the team in scoring. Isaac Haas, with 10 points, was the only other Boilermaker to reach double figures.
Sulaimon had 21 points and a career-high 10 rebounds, and Carter added 19 points to help Maryland improve to 31-1 at home over the past two seasons.
"Defense, rebounding, executing late, getting to the foul line," coach Mark Turgeon said.
Maryland went 24 for 27 at the line. Purdue was 2 for 5.
Trimble's first basket, with 10:53 left, put the Terrapins up 43-40.
Purdue responded with three straight field goals. The first two were from Hammons, who had just returned from a seven-minute stay on the bench with three fouls.
Hammons did not score again until after the Terrapins had gone ahead 56-51.
Diamond Stone followed Hammons' basket with a dunk, Sulaimon added a three-point play and two free throws by Trimble made it 63-53 with 1:03 to go.
"We had some poor decisions at the end of the game," Painter said. "It was just a couple of plays, but that's enough to get beat."
Purdue: The Boilermakers came in ranked second in the nation with a plus-12.3 rebounding margin, but in this one each team had 37.
Maryland: The Terrapins' starting backcourt of Sulaimon and Trimble totaled 15 rebounds. "We have a bunch of guys who can move their feet, rebound and block shots," Carter said.
Purdue: The Boilermakers have trailed by double-digits in only three games this season. ... Guard Kendall Stephens returned after missing three games following the death of a close friend and former high school teammate. Stephens didn't play.
Maryland: After scoring four points in 16 foul-plagued minutes at Nebraska, Carter hit two 3-pointers in the opening 4 minutes. ... Maryland improved to 2-0 against Purdue. The teams first met in January 2015. ... Maryland's last defeat at home was against Virginia on Dec. 3, 2014. ... Former Terps coach Lefty Driesell was given a standing ovation when introduced during a first-half timeout.
Purdue hosts Michigan State on Tuesday night.
Maryland takes a break from the Big Ten, facing local foe Bowie State at home Tuesday night.