The coach who inspired a character in “The Basketball Diaries” sexually abused young boys from the 1950s through the 1980s, according to a lawsuit filed by 20 alleged victims against the Madison Square Boys and Girls Club.

Nicholas Antonucci, the club’s long-time gym director and basketball coach, allegedly “fondled boys’ genitals” inside the gym, locker room, closets and swimming pool in view of other staffers, according to the Manhattan Supreme Court lawsuit filed Monday.

Jim Carroll’s 1978 memoir “The Basketball Diaries” — later adapted into a movie starring Leonardo DiCaprio — detailed a gym coach “Lefty,” based on Antonucci, who “likes to do funny things to you like put his hands between your legs,” according to the lawsuit.

In the 1995 movie, Lefty’s character was renamed Swifty to avoid lawsuits, the court papers say.

Antonucci allegedly touched the boys inappropriately on away basketball games and while he “wrestled” and “horse played” with them, the court papers charge.

During overnights on the club roof, he is accused of going skinny dipping with the boys and playing “games” involving their genital areas, the court documents allege.

Antonucci also made a boy climb up a totem pole while he was naked and other boys looked on. The coach then attempted to allegedly violate the boy as he came down the pole, the lawsuit claims.

Antonucci was eventually convicted for sexually abusing children, according to the lawsuit.

Some of the plaintiffs in the suit also say they were victims of notorious pediatrician Reginald Archibald, who allegedly sexually abused over 1000 children during annual exams where he would fondle them, force them in sex acts and take nude pictures of them.

The lawsuit was filed under the Child Victims Act that went into effect last month, opening up a one-year “lookback” window for former child victims to bring old claims that have since passed the statute of limitations.

“For years, as MSBC claimed that it provided young boys with a safe place to belong and stay out of trouble, it was instead giving serial child predators unfettered and unsupervised access to thousands of New York City children,” Jennifer Freeman, one of the plaintiffs’ lawyers said.

MSBC said they couldn’t comment on the suit but said the organization “applauds the courage of all those who have come forward to describe their painful experiences, which strike at the very core of our organization’s values.”

“Nothing is more important to Madison than the safety and well-being of the children we serve, and we have strict policies in place to make sure our club members are safe at all times and that our staff is trained to identify and report any signs of abuse,” the club said.

Freeman said she believes that Antonucci is dead. Contact information could not immediately be found for him.

Archibald, who died in 2007, practiced at Manhattan’s Rockefeller University Hospital as an endocrinologist specializing in child growth from 1948 to 1982.

A series of lawsuits have also been mounted against the hospital for Archibald’s alleged abuse.