Anthony Cowan Jr. and Maryland ran away from Purdue in the second half of a 70-56 victory. (John McDonnell/The Washington Post)

Even at home, it’s daunting to face an upward-trending team, one that had been riding a winning streak since early January. Now toss in the fact that the visiting program boasts the Big Ten’s leading scorer. The task at hand could only seem more challenging when that star player from Purdue, Carsen Edwards, was smiling and laughing on the court early in the game, despite the pro-Maryland crowd at Xfinity Center surrounding him, as if he already knew what kind of night he thought he would have.

So how does a team overcome a player of that caliber and an opponent that has won eight straight games? The No. 24 Terrapins found a way.

In a 70-56 win over No. 12 Purdue, five Maryland players scored in double digits, including three freshmen. Bruno Fernando notched his seventh straight double-double with 12 points and 12 rebounds. The Terps rode a late-game surge: Rather than collapsing under pressure, Maryland outscored Purdue 40-18 in the second half and held the Boilermakers to 16.7-percent shooting after the break.

By the time just under six minutes remained on the clock, Maryland freshman guard Eric Ayala was the one smiling. Fernando, whose dunk had just pushed the Terps’ lead to seven points and forced Purdue to take a timeout, screamed and brought his fists toward his face, flexing as the crowd around him roared.

In search of a résumé-boosting win and a spot among the top four teams in the conference, Maryland (19-6, 10-4) helped its case for both and stayed undefeated at home in Big Ten play. And the Terps did it with a group that included five freshmen in an eight-man rotation.

“They have a bunch of 19-year-olds running around out there making shots and making plays,” Purdue Coach Matt Painter said after the game. “That’s pretty cool. You get to see guys grow. The thing that’s kind of amazed me about Maryland is young guys are often not very good defenders. It takes them a while. … Those guys can guard.”

Two freshmen also led Maryland’s offensive effort, with Jalen Smith scoring a team-high 16 points and Ayala adding 15. During one stretch in the second half, freshmen scored 21 straight points for the Terps.

“You said 21 straight points by the freshmen?” Ayala said when a reporter mentioned that youthful run. “Oh, wow. That’s tough.”

But to win, Maryland had to contain Edwards, one of the best players in the league. The Purdue guard scored 17 points in the first half, and Darryl Morsell, the Maryland player tasked with defending Edwards, said he took it personally.

“It was tough,” Morsell said. “Because I feel like on all his shots, I made it as tough as I could for him. I was right there. He was still hitting them. My teammates kept me up. I couldn’t let my confidence waver, because it’s a long game.”

With Edwards serving as the Boilermakers’ fuel, the Terps trailed by eight points at the half. But then Maryland leapt ahead after the break. The difference in the second half?

“Darryl Morsell,” Ayala said. “He was key for us. He was working all night. Carsen made some tough shots. He’s going to do that. But Darryl gave him everything he had."

Edwards left College Park with 24 points, but he only made two of his 13 shots from the field after halftime.

Purdue (17-7, 10-3) led by as many as 11 early and took a 38-30 lead into halftime before the Terps came alive. Smith tied the score with a dunk with 15:53 to play, capping Maryland’s 10-2 run out of the locker room. Later, Anthony Cowan Jr. found Jalen Smith in transition for an alley-oop for Maryland’s first lead of the game with 10:14 to play. Maryland finished the game on a 28-8 burst.

Cowan, the Terrapins’ leading scorer, has been in an offensive slump, shooting just 29.4 percent from the field in the previous five games. During that stretch, he reached double digits in points only twice after opening the season with 19 straight games with at least 10. He had mixed results Tuesday, finishing with 12 points on 4-for-9 shooting, six assists and six turnovers.

When these two teams met in early December, Purdue won by two in West Lafayette, Ind., after the Boilermakers blocked what could have been a go-ahead three-pointer from Cowan in the final seconds. Since then, both teams have changed and developed. Maryland has leaned on its bench more, and the Terrapins’ core of freshmen has improved.

“I went back and watched that film today and it made my stomach hurt, because man we were young,” Maryland Coach Mark Turgeon said. “We just played hard and gutted it up, but we had no business in that game. And we’ve come a long way."

While Purdue’s offense still centers around Edwards, the Boilermakers have also found others to pitch in offensively. On Tuesday, however, no other Purdue player finished in double figures.

Maryland began the game shooting 0 for 7 and had yet to score by the first media timeout. Smith took five of those opening shots, with two coming from deep, before he got the Terps on the board with a fast-break dunk nearly five minutes into the first half.

Maryland never led during the first half, but the Terps managed to trim Purdue’s lead to three points late. But then a foul on Fernando sent Edwards to the foul line, where he hit a pair of free throws, and Ryan Cline hit a deep three-pointer with four seconds to go in the half, sending the Boilermakers to the locker room with an eight-point advantage.

“My whole thing was body language at halftime,” Turgeon said. “'Guys, we can win this half by nine. Building’s going to be full. We can win by nine.' That’s what it was about.”

Maryland saved its best half for last, finding those nine needed points plus more and earning a convincing win over a top opponent.

Read more:

There could be NET winners and losers in the NCAA tournament bracket

Maryland lawmakers want details on ‘jarring price tag’ of football investigation

A Maryland lacrosse player lost a friend to suicide. He honored him Saturday.