Maryland baseball third baseman AJ Lee smiled as he rounded third base after belting a go-ahead home run in the eighth inning against Towson on Wednesday night.

He jumped and hugged center fielder Zach Jancarski after crossing home plate. He swung his arm in the air twice and then bumped right fielder Marty Costes’ chest.

Lee’s teammates haven’t stopped their tactics, still calling him “skinny” and “slim,” refusing to believe he’s capable of hitting home runs routinely. But the sophomore’s sixth home run this season lifted the Terps to a 6-5 win over Towson at Ripken Stadium and its third Ripken Cup victory.

“When I have a swing like that to give the team a lead, I don’t think anyone’s going to say anything,” Lee said. “We’re all jacked up.”

From the outset, Maryland’s 30th win resembled its previous midweek contests, when the squad struggled to hang on to an early advantage.

Maryland baseball coach John Szefc, who is now the lone manager in Maryland history to post five consecutive 30-win seasons, said Tuesday that right-hander Ryan Hill would start the contest. It was the earliest he’d made such an announcement ahead of a midweek game since right-handers Hunter Parsons and Cameron Enck struggled to secure the job.

Hill, who has emerged as a consistent middle reliever for the Terps this season, kept the game close through the first few innings, allowing Szefc and assistant coach Ryan Fecteau to use several other relievers as the game progressed. He allowed just one hit over two scoreless innings.

However, Maryland’s offense had difficulty scoring against Tigers right-hander Matt Allen, who entered Wednesday with a 6.31 ERA. Shortstop Kevin Smith’s fourth-inning sacrifice fly and first baseman Brandon Gum’s double down the third-base line in the sixth provided most of the offense.

“We left the bases loaded twice, which usually when you’re the home team is the kiss of death,” Szefc said. “It wasn’t like they were bad at-bats. We had a couple of ugly spots, but we found a way to figure it out.”

But a 3-1 lead wasn’t large enough for Maryland’s busy bullpen, which allowed three runs in the seventh. By the time Towson left fielder A.J. Gallo singled to give the Tigers a one-run edge in the frame, Maryland had used five pitchers.

But the offense rallied late, largely due to a burst that started in the seventh, when Smith hit a sacrifice fly to tie the game at four. With Allen out of the game in the eighth, the offense completed its comeback via Lee’s home run and designated hitter Will Watson’s bases-loaded, RBI single, pushing the Terps’ lead to two.

Right-hander Ryan Selmer seemingly recorded the third out in the ninth three times, as a catcher’s interference call and infield single loaded the bases to give the Tigers more opportunities. But as has been the case in Maryland’s other come-from-behind midweek wins, the Terps secured the win late.

“I knew we were going to score sooner or later,” Selmer said. “We love winning. We keep it loose and have fun.”