WEST LAFAYETTE, In. — For the third time Thursday, Anthony Cowan forced up a 3-pointer as the clock hit zero.

All three times, the shot failed to draw iron. The first two resulted in shot clock violations, and the third was the final play of the game. Cowan was left exasperated as he looked around and slowly walked in front of the Maryland men’s basketball bench, turning away from the Purdue players going crazy on the other end but finding no respite from the roaring Mackey Arena crowd that surrounded him.

Many of the Terps’ eight road losses last season played out similarly to Thursday’s, with Maryland coming up a few plays short down the stretch.

But the 62-60 loss to Purdue was particularly painful and — in the closing minutes — particularly ugly. No. 23 Maryland had one field goal and four turnovers in the final 6:22, failing to take advantage of Purdue’s similar slump and spoiling what had been a promising showing for much of the night during its first big road test.

“The last seven minutes, we played like a young team. We didn’t play with poise and we didn’t coach with poise,” coach Mark Turgeon said. “I can handle not scoring, but I’d like to get a little better looks than we were getting.”

Clean looks were nonexistent late against the Boilermakers’ swarming defense. Maryland (7-2, 1-1 Big Ten) led for the majority of the game and never trailed by more than three until the final six minutes. A five-point deficit with 5:18 to play, however, turned out to be insurmountable for the Terps’ stagnant offense.

“They just played good defense,” Cowan said. “When it comes down to it, we’ve got to work on spacing. It’s still early.”

The calendar also helps explain Cowan’s failed attempt at a buzzer-beater, Turgeon said. After extending the game with fouling, Maryland was set to inbound the ball from under its basket, trailing by two with 3.0 seconds left.

What unfolded — Darryl Morsell passing to Cowan on the wing, and Cowan heaving a doomed 3-pointer that guard Nojel Eastern blocked — was the team’s third option on the play, Turgeon said. It appeared the Terps tried to set up a lob to forward Bruno Fernando, but that was snuffed out. After the game, Turgeon said he didn’t feel he’d prepared his team for a late-game situation like the one it faced.

“We don’t have a lot of out-of-bounds under [the basket] offense [installed],” Turgeon said. “It’s funny, because I’ve been telling my coaches, we have to get more offense in, out-of-bounds under.”

Turgeon said the team had discussed Cowan potentially passing after receiving the inbound on the wing, but he wasn’t sure whether that option ended up being open, and Eastern wasn’t fooled.

“[Forward Matt Haarms] beat [Fernando] to the spot. We didn’t want an easy layup,” Eastern said. “Cowan, he’s one of their best players, and he tried to get the shots down the stretch. So I just tried to … get a tip on the ball, if anything.”

Cowan took over in the second half to finish with a team-high 18 points, but Maryland’s 34-30 halftime lead was built by his younger teammates. Given their inexperience, Turgeon said Tuesday he couldn’t anticipate how the Terps would react to their first road test, but they looked more at home than the Boilermakers early.

The Terps made four of their first five 3-pointers and had just one turnover in the first seven minutes, while Purdue (6-3, 1-1) opened 2-for-8 from beyond the arc and committed four of the game’s first five giveaways. Maryland led by as many as eight, and had a seven-point lead with the ball on its own end and 45 seconds left.

But in a preview of what was to come, the Terps couldn’t get anything out of the inbound, and Cowan took the first of his three desperation three-point misses. Purdue drained a triple on the other end to pull within four at the break.

The teams went back-and-forth early in the second half before both offenses came to a standstill. Purdue, nursing a five-point lead, could afford to go cold. But for Maryland, it led to another agonizing loss away from Xfinity Center.

“We’re not going to be a great team if we’re just setting ball screens for Anthony late in the game to score,” Turgeon said. “It’s not good. But give them credit, they took us out of everything.”