The Maryland softball team had its best offensive performance of the season against Michigan State on Saturday, but its pitching couldn’t contain the Spartans hitters in a wild, back-and-forth 15-12 loss that closed the Terps’ regular season with their fifth consecutive weekend sweep entering their second Big Ten tournament.

Terps starter Ryan Denhart struggled with her control in the first inning, similar to her start in the first game of the series Friday. She walked the second batter of Saturday’s finale before allowing an RBI double to shortstop Caitie Ladd that gave the Spartans the 1-0 lead.

It appeared the Terps equalized the score in the bottom half of the frame when center fielder Kassidy Cross reached first on a bunt and a throwing error, scoring Skylynne Ellazar from first base.

However, Cross was called out for leaving the basepath, and Ellazar was sent back to first.

“Let me just say, it was a beautiful bunt,” said Cross. “They said I ran out of the running lane. … I want to watch it on tape, that’s all I got to say.”

The Spartans (24-25, 10-11 Big Ten) extended their lead on a solo homer in the second, but the Terps (18-36, 7-16) struck back with four runs in the bottom-half off Spartans starter Bridgette Rainey.

Right-hander Sydney Golden entered in relief of Denhart in the third and promptly allowed three runs, giving the Spartans a 5-4 lead.

The Terps struck back again in the bottom of the third. Maryland took a 6-5 lead with a triple from right fielder Destiney Henderson, and after Ellazar was intentionally walked for the second time of the game, Cross blasted a three-run shot to center field — her second homer of the season — to give her team a 9-5 lead.

The Spartans tagged Golden for four more runs in the fifth — two of which came on a throwing error by shortstop Mikayla Werahiko — tying the game at nine, but Maryland again answered right back in the same inning.

The Spartans intentionally walked Ellazar for the third time, and the Terps made them pay with two singles and a sacrifice fly to plate three runs.

Third baseman Brigette Nordberg provided a two-run single in the frame, part of an impressive day that included multiple key defensive plays, two hits and three RBIs.

“Brigette Nordberg is an outfielder … she’s learned third base this year, so I’ve been impressed with her work ethic,” coach Julie Wright said. “She’s had a few bumps, but she also comes up big.”

Denhart re-entered in the sixth and immediately found herself in trouble, allowing three runs on three hits and an error to level the game again, 12-12.

After a scoreless frame for the Terps offense in the sixth, the Spartans continued the comeback effort in the seventh, using two singles, an error and a walk to take a 15-12 lead.

Maryland couldn’t muster another rally in the bottom half and finished the regular season on a nine-game losing streak that didn’t prevent it from qualifying for the Big Ten tournament for the first time since 2015. Maryland will be the No. 11-seed in the 12-team field.

The Terps honored seniors Ellazar, Henderson and Jacqui Pascual, and Mikayla Werahiko before their final game in College Park.

Ellazar finished the game with no official at-bats, being intentionally walked four times and hit by a pitch once.

“I hate it for her because it’s her Senior Day. Legit, she probably could’ve gone 4-for-4 with four jacks,” said Wright. “They were smart.”

CORRECTION: Due to an editing error, a previous version of this article incorrectly stated Maryland is entering its first Big Ten tournament. It previously qualified for the 2015 tournament, making this year’s competition its second. This article has been updated.