David Felitti appeared at the corner of the Gaithersburg dugout and waved a battery-operated razor at his son, Anthony Felitti, who was posing for photos after the Trojans captured the Maryland 4A state championship.

“Do it,” the elder Felitti shouted. “Do it.”

It was time for the younger Felitti to make good on something he’d said before the season started. It was time for Felitti to shave his beard, which he admitted “looked pretty disgusting, I’m not going to lie.”

“I said I wasn’t going to shave the whole season,” Felitti said. It happened. I said I wasn’t going to shave until we went to championships. So I shaved tonight.”

No. 2 Gaithersburg won its first state championship with a 5-3 victory over Severna Park at Ripken Stadium, and Felitti overcame a rocky start to earn his 10th victory of the season.

Felitti allowed six hits and allowed three of his four walks in the first three innings of the game, and as reliever Brendan Deyo ran out to the bullpen, it looked like Felitti’s night wouldn’t last long. But the Falcons only got one run off of him, and he settled in for his final three innings.

“Remarkable,” Trojans Coach Jeff Rabberman said. “I don’t think he had his best stuff tonight, but that kid just competes and battles his rear end off. That’s what he did tonight.”

And while Felitti held a potent Severna Park offense — the Falcons (20-5) averaged more than nine runs per game this season — at bay, it allowed the Trojans (22-2) to figure out starter Spencer Dietrich (seven strikeouts). The Severna Park right-hander’s breaking ball darted across, through and out of the strike zone, much to the befuddlement of the Gaithersburg batters.

But the Trojans eked across runs when they could. Catcher Trey Martinez got in scoring position when the Severna Park defense misjudged a ricochet. Pinch runner Colin Arnold was part of a three-run third when he scored on a wild pitch. And third baseman Grant Mixell was 3 for 3 with a double and three RBI.

“I just needed to come through for my team,” Mixell said. “I love everybody on the team, and we are just one big family and just the support and everything around me. It’s unreal. I just felt so comfortable up there.”

Severna Park launched one last comeback attempt in the seventh against Deyo, who relieved Felitti for the seventh. Three singles and a walk pushed one run across, so Rabberman turned to left-hander Bradley Sawyer. After allowing a sacrifice fly to Griffin Wild, Sawyer struck out the final two Falcons to capture the title.

Rabberman had come close with the Trojans before, falling in the semifinals last year and in 2011. This championship appearance was Gaithersburg’s first since 1997 and its fifth overall. He admitted he was scared during the seventh inning.

But when he gave the ball to Sawyer, the junior gave him the reassurance he needed.

“Coach,” Sawyer said, “I’ve got this. We’re winning it.”