His most iconic role was a swaggering, trench-coated antihero, so it makes a certain amount of sense that Judd Nelson of “The Breakfast Club” would, eventually, be cast as a pirate.

In the film “Dead Water,” out Friday, the actor plays a non-campy, modern variety: “We edge toward pirate without it being swashbuckling,” Nelson, 59, tells The Post. “I do have a damaged eye in it — very close to an eye patch.”

Nelson happily plays the villain in the thriller, which also features Casper Van Dien. “I think villains tend to be more realistic in the sense that they make both good and bad decisions,” he says. “A lot of heroes, all the decisions they make are good ones.”

This fall he’ll also appear in the war movie “Dauntless” alongside a fellow ’80s name, C. Thomas Howell, a longtime friend. After getting his start with the so-called Brat Pack in 1985’s “St. Elmo’s Fire,” Nelson worked steadily for decades in everything from drama (“New Jack City”), to sitcom (“Suddenly Susan”), to action (“Transformers”) to, recently, TV’s “Empire.” He even did a Hallmark Christmas movie in 2010, before it was trendy.

Nelson had already been in three movies, including “Fandango” alongside Kevin Costner, when “The Breakfast Club” came out, also in 1985. Though its analog library setting may seem alien to today’s teens, the film holds up remarkably well as a timeless portrait of high school emotions.

‘To ignore the reality and tribulations of young people is a huge mistake.’

“Fascinating, isn’t it?” says Nelson, a former New Yorker who’s lived in Los Angeles since the mid-’90s. “If we can remember, high school was a pretty serious time. People get sad, anxious, they have pressure on them. Social division is huge. And to ignore the reality and tribulations of young people is a huge mistake. John Hughes was able to treat younger kids with enormous respect, and he didn’t forget that, you know, young people become older people.”

Nelson, a Maine native and the son of a lawyer dad and politician/court mediator mom, attended a private boarding school in New Hampshire and had a markedly different experience from his on-screen character, the blue-collar upstart John Bender. “Yeah, I mean, I went to school six days a week,” he says. “And we didn’t have shop class!” He says he never entertained the idea of following either of his parents’ professions, especially politics: “No, no. My fuse is too short,” he says.

Nelson’s not a dad (and is single), but says he keeps an eye on what’s going on with the teens. “I saw some video about middle-school kids turning their phones over to teachers, and they’d put them in a drawer for the rest of the afternoon. Half of the kids, for 30 seconds to a minute afterward, just stood there frozen, as if they’d taken their heads!”

Don’t look for Nelson on Instagram, but he’s not trying to be a rebel. “I’m not anti-social media at all,” he says, “there’s just so many hours one can spend awake, and that’s time I spend writing and reading.” Still, he sounds a slightly contrarian note from observing other Twitterers: “I was waiting to see a director two weeks ago,” he says, “and I’m in a room with maybe half a dozen actors, and I was the only one not engrossed in my phone. Either I’m the zombie — or they were.”

Or, as John Bender would say: “Demented and sad, but social.”