An appeals court has decided a former Jones Beach lifeguard can sue the state for age discrimination after he claimed parks officials banned him from wearing his preferred swimsuit during hiring tests as a way of getting rid of older veterans.

Roy Lester, 66, is a Garden City-based bankruptcy attorney and nationally-ranked triathlete who worked summers as a Jones Beach lifeguard for nearly four decades before the controversy. A Nassau judge threw out his lawsuit in 2014, but a May 5 decision from a Brooklyn appellate court said it could go forward.

Court records show Lester took legal action after claiming state parks and recreation officials wouldn’t let him swim in tests to be hired for the 2007 and 2008 seasons wearing “jammers” — a form-fitting swimsuit he’d worn in past tests that resemble bicycle shorts.

“This was flat wrong, because it was aimed at the older guys,” Lester said Monday, calling it part of the campaign to thin the ranks of older lifeguards because of a misperception that they threaten public safety.

He has alleged “Speedo-type” swimsuit briefs are embarrassing for older male lifeguards who prefer jammers for modesty reasons, and that boxer-type swimsuits and board shorts cause more drag in the water during timed tests.

However, the state has claimed parks officials began requiring all state lifeguard applicants on Long Island to wear one of three approved swimsuit styles for testing because some weak swimmers started using speed-enhancing suits to pass a timed test.

“The policy was applied to all applicants, regardless of age, and it was implemented to ensure that applicants took the examination wearing a swimsuit similar to the swimsuit they could wear if performing a rescue,” an appellate court filing from Attorney General Eric T. Schneiderman’s office said in part.

advertisement | advertise on newsday

State officials also have argued that lifeguards with a decade or more of service who are testing for rehire also get an extra five seconds on the timed test and it “thus favors experienced (primarily older) applicants and in no way suggests any intent to preclude older applicants from serving as lifeguards.”

A Schneiderman spokesman declined to comment Monday.

Lester, who is president of Long Beach’s school board and also works seasonally as a lifeguard in Atlantic Beach, said he’ll keep up his fight with a goal of returning to his old summer job of patrolling Field 6 at Jones Beach.

“In life, how often do you get to make a stand?” he said.