When Shawn Petty knifed through the opening between the right guard and right tackle Saturday afternoon, the Terrapins inside linebacker had a clear path at N.C. State quarterback Brandon Mitchell.

The Wolfpack signal-caller tried to roll left and escape the sophomore, but Petty grasped the red jersey and twisted him to the ground. The sack, the Terps’ sixth and final of the day, came on fourth-and-4 and was N.C. State’s final play in the Terps’ 41-21 win.

And for the second time in three games, the Terps defense turned in a masterful performance rushing the quarterback and got a victory out of it. While they have been solid for most of the season, the Terps are at their best when they are getting to the opposing quarterback, and Saturday was just another example of that.

In their seven wins this season, the Terps sacked opposing quarterbacks 30 times, including five performances with at least four sacks. In their five losses, the Terps had just six sacks, and four of those came in their 40-27 loss to Clemson on Oct. 26.

“It’s guys just giving great effort,” coach Randy Edsall said Saturday. “It’s guys using good technique to get there and that was big for us, and because the couple times they were maybe in field goal range and [we] got some sacks and knocked them out of field goal range.”

The Terps have been one of most prolific pass rushing teams in the ACC and in the country this season. The Terps’ 36 sacks rank second in the ACC behind Virginia Tech and are tied for sixth nationally. Plus, they’ve done it without outside linebacker Yannik Cudjoe-Virgil, whom coaches called arguably their best pass rusher, since Oct. 12, when he suffered a season-ending injury in a win over Virginia. The last time the Terps had at least 35 sacks on the season was in 2003, when the Terps took down opposing quarterbacks 35 times.

The Terps were shut out in sacks by opposing offenses three times this year, and they went 1-2 in those games. The Terps couldn’t get to Boston College’s Chase Rettig and Syracuse’s Terrel Hunt in a pair of November losses, but they still managed to beat Virginia in October despite not getting to David Watford.

In their 27-24 win at Virginia Tech on Nov. 16, the Terps sacked Hokies quarterback Logan Thomas seven times, the highest single-game total recorded by the defense since 2002. Defensive end Andre Monroe broke out in that game, sacking Thomas three times, including on the Hokies’ final play in overtime, forcing a field goal attempt.

“The big dudes, you got to use a little more feet to get them down, but I mean he definitely was a big guy,” Monroe said after the Terps’ sixth win. “But you know, it’s hard to explain these things. I’m just playing the game. Like a lot of my teammates are like, ‘Yo, ‘Dre, how’d you make that play?’ And I’d be like, ‘I don’t even know; I’m just playing.’ That’s always my reply.”

Monroe has emerged over the final three games of the season as a force along the defensive line for the Terps. In addition to his three sacks against the Hokies, he had two more against N.C. State.

Monroe’s part of a balanced pass rushing group, too. The Terps have eight players with at least two sacks, while Monroe’s 8.5 rank second on the team behind outside linebacker Marcus Whitfield’s nine. Whitfield and Monroe’s totals are tied for sixth and ninth, respectively, in the ACC and tied for 21st and 28th, respectively, in the nation.

When the Terps’ pass rush has been on, as it was for Monroe on Saturday, it’s been difficult to stop.

“Instincts was flowing, executing the scheme, executing the plays that were being called, and I just felt that groove, that rhythm,” Monroe said. “I’m sure every player knows what that is, and it’s when you got it, you just listen to it and it’s just go, go, go.”

It’s a young group, too. Of the eight players with at least two sacks, only Whitfield is a senior. Outside linebacker Yannick Ngakoue (two sacks) is a freshman, and defensive end Roman Braglio (two sacks) is a redshirt freshman. So as the Terps leave this season behind and move forward to bowl season and the Big Ten, they know they have the talent to continue to get after the quarterback.

And with 13 sacks in their final three games, the Terps have shown they can mount a consistent rush.

“That’s a pretty good day’s work for those guys,” Edsall said.