In the four years since East Rockaway last appeared in a Long Island baseball championship game, the program endured its share of lumps.

“We’ve struggled,” said senior Ryan Kelly, a four-year varsity member.

But as the only Class C team in Nassau County this year, the Rocks earned an automatic berth in the Long Island final. Their 9-9 record hardly was sterling, but it was better than the 23-40 of the previous three seasons.

Kelly said this team “just stuck with it.” That approach, which he adhered to Thursday, produced the program’s first Long Island title since 2007. Kelly tossed a one-hitter despite lacking dominant command as the Rocks defeated Suffolk Class C champion Southold, 3-0, at PAL Stadium in Holtsville.

A win Saturday against North Salem or Pine Plains would send the Rocks to the state semifinals.

Only 60 of Kelly’s 108 pitches went for strikes. He walked six and struck out five. But he trusted his teammates, and after a pair of first-inning errors, the defense was rock-solid.

advertisement | advertise on newsday

In the bottom of the first, Southold loaded the bases and was threatening to match the run Kelly had scored on Mike Acampora’s bloop single.

With two outs, Kelly induced a pop-up into the expansive foul territory behind home plate. Catcher Jacob Barth tracked the ball and made a difficult sliding catch in front of the stands. “That was a great play — best play I’ve seen him make all year,” designated hitter Mike DelGais said.

Said Barth: “Honestly, that was just the craziest play I’ve ever made.”

After allowing three hits in the first, Southold’s Dylan Clausen retired 12 of 13 before Chris Deptulski doubled to deep right with one out in the fifth. Kelly’s single sent him to third, and Kelly took second on catcher’s indifference. Third baseman Greg Gehring made a slick pick on the grass, preventing a run and throwing to first for the second out, but DelGais jumped on a first-pitch fastball for a two-run single.

“The whole game he was throwing me first-pitch strike, first-pitch fastball,” DelGais said. “He came with it again, and I was ready for that one.”

Southold threatened again in the fifth. After shortstop Jorge Hazim’s strong throw on the run retired Shane Zimmer, Adam Baldwin broke up the no-hitter with a single to right-center. Pat McFarland walked with two outs and Noah Mina worked the count to 3-and-1, but Kelly fired two fastball strikes to end the inning.

“That’s Ryan Kelly,” coach James Hickey said. “He’s tough. He competes. He’s the guy that we want out there in a big game.”