Maryland softball was stuck even with Penn State in the top of the ninth. Then, Jaeda McFarland led off the inning with a walk to start a game-winning rally.

Caitlyn Cornwell, pinch running for McFarland, stood at second base with one out after a sacrifice bunt. Diamond Williams, who launched a solo home run in the top of the fourth, came through with a single to left-center field.

Cornwell rounded third and slid home on her stomach safe to score the Terps’ go-ahead run. Madison Runyan added an insurance run with an RBI singe later in the frame.

Courtney Wyche retired the Nittany Lions in order in the bottom of the ninth to secure the extra-innings win.

No. 10 seed Maryland defeated No. 7 seed Penn State in the first round of the Big Ten tournament in Iowa on Wednesday, 3-1. The win advanced the Terps to the quarterfinals, where they’ll face No. 2 seed Michigan on Thursday.

“I think this just shows how much the team can accomplish as long as they believe in themselves and each other and just play one pitch at a time,” coach Lauren Karn said.

[Maryland softball secures spot in Big Ten tourney with 4-3 extra inning win over Wisconsin]

Maryland (24-29) secured its spot in the Big Ten tournament after a weekend sweep over Wisconsin to end its regular season. The production at the plate was crucial, scoring four runs in every game — headlined with a 12-2 win in the series opener.

But the Terps’ offense struggled early against the Nittany Lions, unable to score over the first three innings despite having a runner on base in two of the first three frames.

While Penn State (34-18) secured the series win over Maryland in the schools’ three meetings of the regular season, Wyche, the Terps’ ace, propelled Maryland’s lone win of the series with a single-game Big Ten record 19 strikeouts.

Karn started her best pitcher, Wyche, in Maryland’s most important game of the season. The graduate student pitched well last weekend to push the Terps into the tournament and threw four shutout innings to start her outing on Wednesday.

Wyche gave up one hit in the second frame and a leadoff walk in the bottom of the third but that was all the damage against her early.

“Courtney did a great job staying focused on her job and controlling her pitches,” Karn said. “In moments when it seemed like it would be easy to give into the pressure she shifted her focus to the things she could control. We have talked a lot about climbing a mountain one step at a time and winning a game one pitch at a time. She did exactly that tonight.”

[Maryland softball helps its Big Ten tournament chances with 12-2 win over Wisconsin]

Penn State freshman Bridget Nemeth, who pitched in all three games against the Terps in the regular season, matched Wyche with scoreless frames over the first three innings. Then, Maryland struck in the top of the fourth as Williams blasted a 1-1 pitch over the center field fence to give the Terps a 1-0 lead.

“Diamond has been working really hard to stay positive while going through an offensive slump,” Karn said. “She really kept herself in the game regardless of the result of her at-bats and that allowed her to come up clutch in two huge moments for us.”

The Nittany Lions responded with their own solo home run shortly after in the fifth frame, courtesy of Liana Jones, to even the score at one.

Penn State nearly rallied later in the inning — it loaded the bases with two walks and a single over the next four batters. But a fielder’s choice and a groundout kept the score tied as Wyche escaped further trouble.

Scoreless sixth and seventh frames forced extra innings, with both starters still pitching in the circle.

Nemeth ultimately floundered in the top of the ninth, allowing the Terps to push ahead for the win. Wyche didn’t allow a single base runner during the two extra frames. She finished with five strikeouts in a 136-pitch performance.

Maryland will look to keep its season going when it faces Michigan on Thursday, an opponent it didn’t play in the regular season.