In the first two games against Rutgers, the Maryland baseball team’s starting pitchers struggled. Right-hander Mike Shawaryn surrendered two runs on 96 pitches through his five innings Friday, and the Scarlet Knights touched up right-hander Taylor Bloom for six runs in seven innings one day later.

Right-hander Brian Shaffer bucked that trend Sunday, though, tossing eight scoreless innings. Shaffer helped the Terps avoid a sweep with a 6-0 win on Senior Day to snap a five-game losing streak in the series finale.

“I was just glad our guys were able to come out, give a good answer and get out of this weekend salvaging something,” coach John Szefc said.

Early in the game, Maryland’s offense struggled to produce runs. The Terps put runners on base in four of the first five innings but couldn’t score until the sixth.

Right fielder Anthony Papio started the rally with a leadoff double, though the Scarlet Knights tagged him out while the redshirt senior tried to score on a squeeze play.

But the Rutgers pitching staff lost control in the frame, tallying four walks and one hit by pitch. One of the walks and the hit by pitch came with the bases loaded, resulting in two Terps runs. Maryland then scored another on a wild pitch and finished the inning with a 3-0 lead on one hit.

The seventh and eighth innings produced similar results. Maryland picked up six walks — two of which came with the bases loaded — in those frames en route to scoring three more runs.

“Our main objective of this game was to get into the bullpen early and see what we could do,” shortstop Kevin Smith said.

In Games 1 and 2, Rutgers turned to its bullpen for a combined two innings. Sunday, the Scarlet Knights relieved right-hander Serafino Brito after 5.2 innings. The four bullpen pitchers faced 16 batters, walked eight, and threw two wild pitches.

Papio thought his team’s performance against the bullpen was set up by at-bats earlier in the game.

“Us being as aggressive as we were early to anything over the plate, that takes a toll on a pitcher,” Papio said. “They’re afraid to make a mistake and leave something out over the plate.”

Shaffer, meanwhile, limited his lapses. He allowed three hits, and perhaps Rutgers’ best scoring chance came on an error.

In the second inning, amid gusty winds, what looked like a routine fly ball to left field blew toward center field. Left fielder Marty Costes tracked it but could not corral it, and the Scarlet Knights batter reached third base with one out.

Shaffer said he wasn’t worried about the situation as he picked up a strikeout — one of his career-high eight on the afternoon— and a fly out to end the inning.

“That was a really big point in that game, because it keeps the game even,” Szefc said.

Szefc said the strong winds made Sunday “a tough day to hit.” Shaffer took advantage of the conditions.

“Today, it was nice because all of my pitches were working [and] I could locate them,” Shaffer said. “I was pumped.”

Freshman right-hander Hunter Parsons replaced Shaffer to start the ninth inning and retired the two batters he faced. Then left-hander Rob Galligan, one of the team’s two seniors honored on the day, took the mound.

Galligan entered to a standing ovation, but he said he was so focused he didn’t notice until his mom told him after the game. After allowing a double, he got the final out on a lineout.

The win keeps the Terps in control of their own destiny and helped the team avoid its first sweeping defeat of the season. If Maryland can sweep the series against Michigan State next weekend, they will secure a spot in the Big Ten Tournament.

“It was a big day for us, coming back from … four frustrating [games] in a row that put us in a really big hole,” Szefc said. “We certainly needed to come out and play well here today to keep some hope going into next weekend.