This article contains spoilers for the documentary “Three Identical Strangers,” opening Friday.

When 19-year-old Robert Shafran drove from his home in Scarsdale, NY, to the Catskills for his first day at Sullivan Community College in 1980, he was shocked to find that everyone already knew and adored him.

“Welcome back!” guys said. Girls ran up and kissed him. Finally, a fellow student, Michael Domnitz, connected the dots after asking if Shafran was adopted: “You have a twin!” he said.

Domnitz was a friend of Edward Galland, who’d dropped out of Sullivan the previous year. He knew Galland was also adopted, and he called him right away. Shafran was stunned to hear a voice identical to his own on the other end of the line — and decided he couldn’t wait to meet his “new” brother. That day, Shafran and Domnitz drove to the New Hyde Park, LI, home where Galland lived with his adoptive parents.

When the door opened, Shafran says in the film, he saw his own face staring back at him: “It was like everything faded away, and it was just me and Eddy.”

But as he would soon discover, it wasn’t.

Months later, David Kellman, a student at Queens College, saw a news story about the reunited twins and recognized his own face in the photos. He called Galland’s house and got his mother, who said: “Oh my God, they’re coming out of the woodwork!”

“Three Identical Strangers” chronicles a story so wild that, as Shafran says in the film, “I wouldn’t believe [it] if someone else was telling it.” And once the long-lost siblings found each other, their story became even more shocking as they discovered they had been part of a decades-long psychological experiment that had controlled their destiny.

The triplets were born to a teenage girl on July 12, 1961, at Hillside Hospital in Glen Oaks, NY. Split up at 6 months by the now-defunct Manhattan adoption agency Louise Wise Services, the boys were raised within 100 miles of each other. None of the adoptive parents knew of the other brothers.

‘Those who were studying us saw there was a problem happening. And they could have helped … and didn’t.’

Before the babies were placed in their adoptive homes, the agency had told the prospective parents that the children were part of a “routine childhood-development study.” The parents say it was strongly implied that participation in the study would increase their chances of being able to adopt the boys.

For the first 10 years of their lives, the siblings were each visited by research assistants led by Dr. Peter Neubauer, a prominent child psychologist who had worked closely with Sigmund Freud’s daughter, Anna.

“It appears there were at least four a year for the first two years and a minimum of one visit per year after that,” said the film’s director, Tim Wardle. Officially, the study went on for a decade; however, said Wardle, “it’s clear from some of the study records that the scientists continued to follow from a distance and collect data on the triplets’ progress for many years after this.”

Neubauer’s study, initially brought to light by New Yorker writer Lawrence Wright, involved separating a still-unknown number of twins and triplets at birth and placing them with families of varying economic and emotional reserves. The intention? To answer the question of nature versus nurture.

The brothers were placed with families who were working class (Kellman), middle class (Galland) and upper middle class (Shafran). Kellman’s father, a grocery store owner, was a warm and loving man who eventually became affectionately known as “Bubula” to all three of the young men. Shafran reports his upbringing to have been slightly more reserved, with his doctor father often away. Galland clashed with his father, who, according to Wardle, “had a different idea of what men should be.” Collectively, they represented a spectrum of “nurture.”

“That era, the ’50s and ’60s, was the Wild West of psychology,” Wardle said. “The Milgram experiments [on human obedience], the Stanford Prison Experiment. Psychology was trying to establish itself as a new science, and people were pushing the envelope.”

Still, Neubauer and his associates were not roundly accepted, said the director. “They approached other agencies to be part of the study, and [were told], ‘You can’t split up twins and triplets — what are you thinking?’ Even at the time, it was pretty extreme.”

Conducted in the families’ homes, the meetings involved cognitive tests, such as puzzles and drawings, and were always filmed. Behavioral problems were evident almost immediately in the triplets. According to their adoptive parents, as babies, all three would regularly bang their heads against the bars of their cribs in distress.

Kellman thinks he knows why: “It was absolutely separation anxiety.”

Mental health issues continued as the boys got older. By the time they were college age, Kellman and Galland had been in and out of psychiatric hospitals; Shafran was on probation after having pleaded guilty to charges connected to the murder of a woman in a 1978 robbery.

“Those who were studying us saw there was a problem happening. And they could have helped,” Kellman told The Post. “That’s the thing we’re most angry about. They could have helped . . . and didn’t.”

In the early days, life for the reunited triplets was a party. The strapping young men made the talk-show rounds and moved into an apartment together in Flushing, Queens.

“We were sort of falling in love,” said Kellman of the time. “It was, ‘You like this thing? I love that!’ There was definitely a desire to like the same things and to be the same.”

But as they spent more time together, he recalled, “there would also be times when one of us was closer to another. And it was not fun to be the odd man out.”

They met their mother, briefly, in the early ’80s. Hers was an underwhelming story, says Kellman in the film: “A prom-night knock-up.” She had drinks with them but didn’t pursue any further relationship.

In 1988, the trio opened a restaurant in Soho, called Triplets Roumanian Steakhouse. (Shafran left the business several years later, and it closed in 2000.)

“We did do a lot of crazy things,” Shafran told The Post. “Like march down 42nd Street with one of us perched on the other two’s shoulders, stopping traffic.

“One night, we ran into [celebrity photographer] Annie Leibovitz,” Shafran added. “She said, ‘I work for the Village Voice and Rolling Stone. Let me hang out and take your picture.’ She took us to Peppermint Lounge and the Mudd Club. We were wearing these Izod Lacoste shirts and, like, matching white jeans, going to places where people had multiple piercings and all kinds of color in their hair. We felt like virgins in a brothel!”

They were also spotted on the street by director Susan Seidelman. “She was like, ‘You’re the guys! Will you be in my film?’ ” Shafran recalled. That film was 1985’s “Desperately Seeking Susan.” In one scene, Madonna jumps out of a convertible and heads into an apartment, catching a smile from the three brothers lounging by the stoop.

“We were kind of cautious about doing it,” said Shafran, “because the whole crew had this sort of leathery, punk look.”

As the triplets basked in their newfound bond and endless similarities, their adoptive parents were beginning an investigation into why the trio had been separated in the first place. They convened a meeting with several officials at Louise Wise, who gave them little information.

“They said the reason was because it was hard to place three children in one home,” Kellman says in the film. “At that moment my father blew his stack. He said, ‘We would have taken all three. There’s no question.’ ”

The parents left frustrated and angry, but Shafran’s father had forgotten his umbrella. “He went back to get it,” says Shafran’s stepmother in the movie, “and he walked into the room to see them breaking open a bottle of Champagne and toasting each other, as if they had dodged a bullet.”

The furious parents vowed to take legal action. But, said Wardle, “they couldn’t find any law firms that would take the case — some firms told the parents they had partners who were trying to adopt from the agency and they didn’t want to damage their chances.”

Eventually, the brothers married off and had kids of their own: David and Janet Kellman had two daughters, Ali and Reyna; Robert and Ilene had a daughter, Elyssa, and a son, Brandon; and Eddy and Brenda had one daughter, Jamie.

Of all the triplets, Galland seems to have been the one who was the most affected by their discovery of one another. Growing up, Galland and his adoptive father “didn’t quite see eye to eye,” Wardle said. “They had a very dysfunctional relationship. So when he met his brothers for the first time, he felt, this is my family. He put everything into being with the boys.”

But in 1995, Galland, who had exhibited increasing signs of bipolar disorder, killed himself with a gun at his home in Maplewood, NJ.

“A heartbreaking detail that isn’t in the film is that Eddy moved several times so that he could be close to the brothers,” said Wardle. “He did that, I think, three times. He had moved close to David and his family when he ultimately died — he was living across the street from them, which is kind of tragic.”

After Galland’s suicide, Shafran and Kellman drifted apart, their relationship indelibly marked by the whiplash of initial euphoria and the harrowing events that came later.

“It would be fair to say their relationship was very strained from the point [Robert] left the restaurant,” said Wardle, who says the two remaining brothers did begin to get somewhat closer over the course of making the film.

Today, Shafran is a lawyer living in Gravesend, Brooklyn; Kellman, who is still in New Jersey and in the process of a divorce, is an independent general agent working in life insurance, Medicare and annuities. He has remained in touch with Galland’s wife and daughter. “My daughter and Jamie are extremely close,” Kellman said.

After everything they went through, the study that so altered the triplets’ lives was never published. Neubauer shelved his findings, and upon his death in 2008 and according to his orders, all documents related to the study were placed with Yale University and restricted until 2065.

Through an attorney, the remaining siblings eventually gained access to thousands of pages of documents from the archive. “We were given some discs with notes and stuff like that, and it was pretty heavily redacted. Everything I got was just about me — it wasn’t about visits to me versus visits to Eddy,” said Shafran.

Wardle was able to access short clips of film from the study, and the end credits play over archival footage of the triplets as toddlers, separately working puzzles, taking tests and looking quizzically at the person behind the camera who’s so interested in their behavior.

Their search for answers as to why it was ever allowed to happen is still not over. “There are people living in New York City now, practicing psychiatrists, who were heavily involved in setting [the study] up,” Wardle said. “They refused to talk to [the filmmakers] even when we had the proof they were involved in it.” But, he hopes, once the film is out, “there will be a lot of attention on those involved.”

In the film, viewers hear a recording of the psychologist speaking with New Yorker writer Wright about his work. “Neubauer showed no remorse,” Shafran said of that clip. “If anything, he reinforced his position. We were subjects, and it was a study. [But] you don’t do a study with human experimentation.”

Robbed of the chance to confront Neubauer in life, Kellman is seen directing his anger into the camera. “Why?” he says. “What did you do? Why? And how could you?”