Maryland baseball has had 18 comeback victories this season. Wednesday’s was likely the most improbable.

The Terps were scoreless and trailed by eight in the fifth inning after USC Upstate connected on four home runs. Then the Terps responded.

Kevin Keister approached the plate as the go-ahead run while Maryland trailed by two in the seventh. The Terps’ captain lifted a third pitch over the center field wall, trotting around the bases before stomping on home plate and stamping the Terps’ first lead with a three-run shot.

Keister’s home run was one of five Maryland home runs after the fourth inning — surging the Terps’ 11-8 comeback victory over USC Upstate. Maryland’s eight-run deficit was the largest the Terps have overcome this season.

“The whole season, no matter how far we’re down, our team always has good energy,” catcher Devin Russell said. “When it started rolling, it started rolling.”

Maryland wasn’t originally scheduled to play USC Upstate. But following a midseason skid, coach Matt Swope knew the Terps needed to add more quality opponents to the slate.

Maryland announced an added game against the Spartans on April 12, ranked No. 68 in RPI at the time — which serves as a potential resume boosting opponent for the postseason.

The Terps cycled through four different arms in the first five innings as the Spartans built their lead. Upstate didn’t score after the fifth.

[DeMatha ties, chance to play two sports drew Bud Coombs to Maryland]

Russell and Chris Hacopian began the Terps’ scoring with a pair of home runs in the fifth. Hacopian’s home run was his 13th of the season, the third most from a freshman in program history.

Ben Nardi notched his first homer in a Maryland uniform in the sixth inning, before Jacob Orr brought one home in the seventh with a single.

Russell followed up Keister’s go-ahead shot with his second home run of the game into center field to make it a three-run lead.

Kenny Lippman held the Spartans scoreless in the seventh and eighth before Logan Berrier closed the game in the ninth.

“We obviously haven’t been down eight before but we’ve had some comebacks before so it was just kind of play our game,” Keister said.

USC Upstate was ranked No. 91 entering Wednesday’s game and slotted as a quad three opponent. The Terps are now 9-7 in such matchups. Maryland is ranked 31st in RPI.

The NCAA Division I Baseball Committee recently sent a memo to all head coaches, warning them against canceling a game for reasons other than inclement weather. Teams have commonly canceled nonconference games in recent years in fear of their RPI ranking dropping with a loss.

[Maryland baseball defeats Rutgers in rubber match, 6-4, secures series win]

Swope and the Terps did the opposite, instead adding a game in hopes of improving their standing.

“We’ve had situations in the past three years where people canceled on us, and I won’t schedule them again,” Swope said. “Coaches can hide behind that but if you schedule a game, I think you should play. That’s always been our stance.”

Maryland added another game this weekend against Boston College, ranked No. 75 currently, which Swope also noted is meant to boost the Terps’ resume.

Swope understands the importance of RPI. Despite winning both the Big Ten regular season and conference tournament last season, Maryland was ranked No. 35 in RPI. The committee sent the Terps to Winston-Salem as a two-seed to face Wake Forest, the No. 1 team in the county.

“That was the biggest joke in the history of college baseball, being sent to the number one team in the country,” Swope said.

But Swope’s attention has shifted to the Terps making it into the conference tournament.

The top eight teams make the Big Ten tournament and Maryland currently sits in eighth place, with Michigan State and Ohio State battling with the Terps for the final two sports. The Terps only have one Big Ten series left, facing Penn State (21-20, 7-11 Big Ten).