Pete Nielsen couldn’t sit still during school at Madison on Wednesday, not with the Warhawks’ Virginia 6A North region semifinal against Battlefield waiting in the evening. So the shortstop sat “twitching” in his seat during class and counting down the minutes until first pitch.

Hours later, Nielsen drilled a pitch from Battlefield’s Keegan McGinnis to dead center field for a walk-off RBI double to send Madison to the 6A North region final and its first state tournament appearance since 2003 with a 2-1 victory in nine innings over the Bobcats. Madison will face Chantilly, last year’s Virginia 6A runner-up, on Friday for the region title.

In the top half of the ninth inning, Nielsen came on in relief and put runners on second and third with no outs before striking out three straight batters to preserve a 1-1 tie and set up his own heroics.

“This game was everything everybody said it was going to be,” Madison Coach Mark “Pudge” Gjormand said. “I told the kids before the game, we had to be really good mentally. We had to grind.”

Madison had to outlast a sparkling start from Battlefield ace Jake Agnos. The left-hander struck out 14 in eight innings of one-run ball and allowed only one hit, which came with one out in the seventh inning.

But Warhawks left-hander Brian Eckert matched zeroes with Agnos. The Radford signee allowed one run and three hits in eight innings even though he struggled with his control, walking three and hitting three. He was one strike away from a shutout in the seventh before Agnos scored to tie the game when a pitch got away from Madison’s catcher.

“I didn’t have my stuff tonight, so I was just trying to get the ball in the zone and let my guys do the work,” Eckert said. “That’s what they did tonight.”

When Madison’s quarterfinal matchup against Herndon was rained out Monday evening, Gjormand took the Warhawks into the gym and showed them the state banners that hang there. Despite a series of impressive regular seasons, the Warhawks had fallen short in the postseason in recent years.

“I feel like we’ve broken through a wall we haven’t been able to break through in forever,” Nielsen said. “ . . . The dam just broke.”

In the other semifinal, Chantilly beat Centreville, 8-4, to return to the Virginia 6A North region championship game. Jared DiCesare hit a grand slam that provided the difference for the Chargers. . . . Forest Park lost to First Colonial, 4-3, in the Virginia 6A South semifinals. . . .

Stone Bridge reached the state tournament with a 4-1 win over Mountain View in the Virginia 5A North semifinals. The Bulldogs will face Marshall or Patrick Henry-Ashland, which ended Broad Run’s season with a 1-0 win in Richmond. . . . Woodgrove advanced to the Virginia 4A North semifinals with a 5-1 victory over Harrisonburg. . . . Loudoun Valley’s Jack DeGroat tossed a no-hitter and struck out 16 to beat Culpeper in the Virginia 3A East quarterfinals.