As first baseman Maxwell Costes ranged to his right for a ground ball in the hole in game two Saturday, the freshman looked to be in position to turn an inning-ending double play and get Maryland baseball out of a bases-loaded jam.

The Terps had already sewn up the series with a 6-4 win in game one of the doubleheader — their third consecutive road series triumph. But having failed to notch a series sweep so far in Big Ten play and trailing 2-1 with a runner at each base, Maryland needed Costes to keep the third-inning grounder in front for a chance at a perfect weekend.

Instead, Costes muffed the backhand attempt, allowing two runs to come in, and the floodgates opened. The Nittany Lions plated three more in the inning, and the Terps’ bullpen served up just enough mistakes to allow Penn State to escape with a 10-7 win in game two.

If the early part of the season has been any indication, Maryland (21-22, 8-7 Big Ten) didn’t seem like the likely victor with right-hander Zach Thompson on the mound to start game one.

The Terps were winless in the redshirt sophomore’s previous four Big Ten starts — 0-8 overall since beating Maine on Feb. 22. With a 4-0 mark in game ones so far in conference play, the squad has wasted several opportunities to avoid rubber matches.

Following a 5-2 triumph over the Nittany Lions (19-20, 2-15) on Friday, Maryland earned another opportunity to avoid a deciding game three, this time against the last-placed team in the conference.

An early defensive miscue by Penn State put Maryland in a prime position to avoid a similar fate.

Right-hander Eric Mock corralled a bunt by left fielder Caleb Walls, who was attempting to move Costes to third after a leadoff double, but the redshirt junior’s throw to first ended up in right field, and Costes easily scored.

Designated hitter Shea Sbranti tied it up the next inning by crushing a hanging breaking ball from Thompson over the right-field wall — his second homer of the year. But Maryland didn’t relent.

The visitors rallied with two outs in the fifth, as right fielder Randy Bednar narrowly missed a home run after roping a full-count delivery off the top of the right-center wall. Still, the double plated a pair to put the Terps in front again, 3-1.

After avoiding free baserunners through six innings, Thompson abruptly struggled to put the ball over the plate late, despite a manageable pitch count. He hit back-to-back batters to begin the seventh, one scored, and was pulled after issuing a walk to the first batter of the eighth.

The Nittany Lions clawed back with two runs in the eighth, but a seventh-inning two-run shot from catcher Justin Vought and a ninth-inning home run by third baseman Taylor Wright provided Maryland just enough insurance for right-hander John Murphy.

He labored through 32 pitches, but the senior stranded a runner to notch his second straight save of the series and ninth of the season, securing a series win — the Terps’ third series victory in four weekends.

Shortstop AJ Lee continued a torrid April offensively. And with a leadoff single through the left side on the first pitch of game two, he upped his hitting streak to 10 games.

Lee later crossed home standing up following an RBI single by Walls that provided the Terps another early lead, but Penn State immediately countered with a run after second baseman Kris Kremer hit an RBI double in the left-center gap.

Then right-hander Trevor LaBonte unraveled.

The freshman started the third by walking center fielder Derek Orndorff, who had yet to record a hit during the 2019 season, and when the next three Nittany Lions reached, coach Rob Vaughn was forced to pull his starter after just two innings.

Left-hander Drew Wilden nearly got out of the jam after popping up Kremer and forcing a would-be double-play ball. But Costes’ miscue kept the inning going, and Penn State led 6-1 after the rough frame.

Although the Nittany Lions’ defensive struggles reemerged, as a trio of errors in the fourth and fifth innings allowed Maryland to get five runs back — three unearned — the Terps’ bullpen reciprocated with mistakes of its own.

Wilden, right-hander Mark Diluia and left-hander Sean Fisher combined to allow four additional runs in the middle innings, negating any hopes of a Maryland comeback. And Penn State held on to take game two of the doubleheader, 10-7, preventing the Terps’ from getting their first sweep of the Big Ten slate.