Matt Shaw faced a two-strike count with two outs and the bases loaded in his sixth-inning at bat. He was one pitch away from squandering Maryland’s best chance at taking a lead in a game its offense was previously held in check by Iowa pitching.

The next pitch hung over the middle of the plate as Shaw lasered in on it. Almost immediately after the ball left his bat, Shaw flipped it in celebration, knowing exactly where the ball was headed.

Maryland’s sixth grand slam of the season flipped a three-run deficit to a one-run lead over No. 25 Iowa (19-5, 0-1 Big Ten), but more was needed after that advantage was lost an inning later. Elijah Lambros provided it, mashing a solo blast to nearly the same spot Shaw slugged his own.

The Terps (16-9, 1-0 Big Ten), who struggled with Hawkeye pitching for most of the game, eventually broke through in the late innings with an onslaught of home runs to take their Big Ten opener, 10-9.

Iowa starter Brody Brecht held Maryland largely in check for most of his start, outdueling Jason Savacool in the matchup of elite aces by silencing the Terps through four innings.

[Maryland baseball knew Kyle McCoy would be a starter. He became one sooner than expected.]

Brecht struck out the side in both the first and second innings, then added two more punchouts in each of the third and fourth. Terps hitters had trouble with his pairing of a fastball that consistently reached 100 mph — and topped out at 104 — with a hard, tight slider.

But he stumbled in the fifth, an inning Maryland got to him for three runs. Nick Lorusso extended his program-record hit streak to 24 games with an RBI single for his team’s first run. Shaw hit another run-scoring single and Brecht balked with the bases loaded to plate one more.

That was Brecht’s final inning, but the Terps continued their breakthrough against the Hawkeye bullpen, which needed to cover four innings with a slim advantage. Shaw’s go-ahead blast followed an Eddie Hacopian leadoff single, a Lambros hit by pitch and Luke Shliger walk.

Iowa reliever Jared Simpson appeared to have the best of Shaw, quickly finding a no ball, two strike count. The left hander’s third pitch likely wasn’t where he wanted to locate it, and Maryland’s best hitter took advantage.

[Bullpen, sluggers propel Maryland baseball to 16-6 win over UCF]

After losing that lead shortly after, three of the first four Terps batters in the eighth inning slugged homers to recapture the advantage and grow it. Lambros, Lorusso and Shaw all homered in the eighth inning to put their team on top for good.

The Terps needed those scores to overcome a Savacool start that was the opposite of Brecht’s. The Terps’ right hander loaded the bases before recording an out in the first inning, then gave up a towering blast to center field that put Maryland in a quick 4-0 hole. He surrendered another homer two batters later and third long ball in the fifth inning.

Three homers is the most Savacool’s given up in a game this season.

His 102nd pitch, which secured the last out in the fifth, was his last. Seven hits and six runs set new season highs, and his two walks tied his previous worst.

He exited with his team trailing, unable to hold down Iowa’s attack while his opponent did. Shaw, who finished 4-for-4 with six RBI and two homers, ensured the pitcher wouldn’t be tabbed for his second consecutive loss, instead opening Big Ten play with a comeback victory.