The latest installment of the recently resumed rivalry between Maryland and Georgetown went to the Terrapins in dramatic fashion Tuesday night, thanks to a furious rally in the closing seconds and a game-saving block by freshman Kevin Huerter that preserved a 76-75 win at Verizon Center.

Down by five with 29 seconds remaining, Maryland (2-0) outscored the Hoyas 8-2 the rest of the way. Junior guard Melo Trimble’s two free throws with 7.6 seconds to play capped the rally and gave Maryland its first lead since early in the second half. Then with time expiring, Huerter got his hand on the ball to thwart Georgetown freshman Jagan Mosely’s drive to the basket.

Trimble finished with a game-high 22 points on 7-for-13 shooting, and freshman forward Justin Jackson added 17 points and seven rebounds in the exhilarating comeback. The Hoyas led by nine points with just more than two minutes to go.

[Mark Turgeon channels Gary Williams with euphoric celebration after beating Georgetown]

Georgetown (1-1) got a team-high 21 points, including 19 in the second half, from junior forward L.J. Peak. Junior forward Isaac Copeland added 13 points and 13 rebounds in just the fifth meeting since 1980 between the schools separated by roughly 20 miles.

Maryland guard Kevin Huerter blocks the final shot by Georgetown guard Jagan Mosely, sealing the Terps’ one-point victory. (Toni L. Sandys/The Washington Post)

“We beat a great team tonight,” Maryland Coach Mark Turgeon said. “I was worried sick. Then [the Hoyas] started to make some shots, and then they made almost every free throw. Our guys never quit. They kept competing.”

The Hoyas sank 37 of 42 free throws, with Peak going 10 of 12, but were unable to overcome 32 percent shooting coupled with 15 turnovers, including two in the final 18 seconds. Among the most egregious miscues was junior guard Tre Campbell stepping out of bounds while dribbling with 8.4 seconds to play.

Ten seconds earlier, Rodney Pryor was called for traveling. The graduate transfer had a game-high five turnovers one game after scoring 32 points in his Hoyas debut on Saturday in a 105-60 win against USC Upstate.

“We have to grow. We have to get better,” Georgetown Coach John Thompson III said. “We have to learn from our mistakes. I mean just too many mental errors down at the end.”

The thrilling result in front of an announced crowd of 13,145 completed the second leg of a home-and-home series as part of the Gavitt Tipoff Games. The Terrapins won last season’s matchup, 75-71, in College Park in the teams’ first meeting since the 2007-08 season.

[Brewer: After a weird, wild Terps-Hoyas game, the rivalry must continue]

This game also marked the first time since 1970 neither program entered ranked in the Associated Press Top 25 when facing one another. Maryland had been No. 25 but fell out after opening the season with a 62-56 victory over American, coached by former Georgetown assistant Mike Brennan, on Friday at Xfinity Center.

Georgetown guard L.J. Peak fouls Maryland guard Melo Trimble from behind in the game’s closing seconds, sending Trimble to the foul line for the clinching free throws. (Toni L. Sandys/The Washington Post)

The Terrapins’ late second-half charge began with them trailing 68-59 with 2:21 left to play. Less than 30 seconds later, the margin had shrunk to 70-66 on Huerter’s three-pointer off a pass from guard Anthony Cowan, another of Maryland’s nine freshmen.

“It was a crazy game,” Trimble said. “They pretty much had the lead all of the second half, and we just kept fighting. We played with a group of freshmen out there that had never been in that environment before, and just for them to go out there and play the way they did and step up when we needed them to was very special.”

The decibel level rose significantly with 9:56 left when officials assessed a technical foul against Turgeon. Peak made both free throws, and after Ivan Bender’s offensive rebound put-back for the Terrapins, Georgetown got Peak’s three-pointer off a drive into the lane and kickout pass by Copeland for a 54-49 lead.

Peak scored 10 of Georgetown’s 13 points over one stretch in the second half during which the Hoyas opened a 60-53 lead with 6:39 to play. The only other Hoyas player to score in that time was Pryor, who sank a three-pointer from the right corner.

[Three takeaways from Maryland’s comeback win over Georgetown]

The lead went back and forth to start the second half, with Maryland ahead 43-38 following back-to-back three-pointers by Jackson. The Hoyas pulled even shortly thereafter on Pryor’s three-pointer from the right corner, and Jessie Govan’s two free throws provided a 47-45 margin with 11:08 to play.

The Terrapins had a 29-24 lead in the final three minutes of the first half on an 8-0 burst capped by Jared Nickens’s three-pointer. Georgetown countered by scoring seven of the last nine points combined to even the score at 31 at intermission.

After forcing Maryland into a shot-clock violation in the waning seconds of the half, the Hoyas had a chance to take the lead but were unable to get a shot off before the buzzer.

“We have to go back and watch the film,” Thompson said. “Not that it’s rocket science or anything. We know what we did wrong. We can’t make those mistakes coming down at the end.”