The Maryland men’s soccer team confronts weekly challenges in the ACC, the nation’s finest league. But to prepare for the rigors and variables of the NCAA tournament, Coach Sasho Cirovski also looks to expose the Terrapins to a diverse slate of nonconference opponents.

Although third-ranked Maryland bolted to a three-goal lead Tuesday night and defeated Charlotte, 3-1, the No. 12 49ers made things difficult with an ambitious style — a welcome test for the unbeaten Terrapins.

“This is the kind of team you run into deep in the [NCAA] tournament and you have to deal with it,” Cirovski said. Scheduling these teams is “with a purpose. Sometimes it’s a little too much, but it seems to have worked.”

The Terrapins (9-0-1) absorbed Charlotte’s pressure, struck back midway through the first half, and secured their best start since 1968. Casey Townsend and John Stertzer sandwiched goals around a Charlotte own goal during a decisive 12-minute stretch.

Maryland, third in the nation in scoring entering the week, has accumulated 13 goals against four ranked opponents (three from outside the ACC). On Friday, it will host second-ranked Creighton, which hasn’t yielded a goal in winning its first eight matches.

“I love games like that; it was chaotic and they wanted to play,” said Townsend, who’s among the nation’s leading scorers with 10 goals. The pace was the polar opposite of last week’s 0-0 draw against Seton Hall, which bunkered defensively and made little effort to attack.

Charlotte (7-2-0) had already won on the road against the ACC’s Virginia and Clemson, and wasn’t fazed by this high-profile encounter. Maryland’s three-goal lead was deceiving. Charlotte presented a confident attack and should’ve gone ahead in the eighth minute when Guiseppe Gentile misfired.

The 49ers remained on even terms until the 23rd minute. Patrick Mullins’s effort from beyond the box deflected off a defender and skidded into Townsend’s path for a low finish past Klay Davis.

Maryland stretched the lead nine minutes later. A swift build-up led to Mullins’s bid that Davis blocked but couldn’t secure. The ball trickled through the six-yard box, and in a moment of desperation, left back Anthony Perez smashed the ball into the net.

Four minutes passed before the Terrapins struck again. Charlotte failed to clear Jereme Raley’s corner kick, allowing Stertzer to finish from eight yards.

The 49ers answered less than a minute later on Donnie Smith’s goal. The margin seemed tighter, and for the rest of the half, Charlotte attacked with vigor.

In a balanced second half, Davis thwarted Townsend and Mullins; Maryland’s Will Swaim made a superb tip save on T.J. Beaulieu; and the Terrapins survived a highly unusual indirect free kick from the six-yard box in the 88th minute.

“It’s good to play teams like that because we like to play [attacking] soccer and we know when teams come here and play [attacking] soccer, it’s always going to be a battle,” Stertzer said. “It’s good for the game.”

AMERICAN 1, VIRGINIA TECH 0: Alassane Kane scored his fourth goal of the year in the 31st minute to lead the Eagles (3-6-1) over the visiting Hokies (3-6-0).

GEORGETOWN 0, PENN STATE 0: The Hoyas went to overtime for the sixth time in their first nine games. No. 17 Georgetown moves to 5-1-3 on the season with its fifth shutout of the season. The host Nittany Lions are now 5-2-2 on the season.

Both teams recorded 12 shots in a game played at times in a heavy rain.