By Alicia Dennis and Michelle Tauber
Updated October 07, 2013 12:00 PM

Last November the son of an entertainment superstar was throwing an afterparty at his Hollywood mansion, and after a night of clubbing, a select group of connected guests turned up at the house to let loose. But the jaded veterans of the L.A. party scene were taken aback when they ran into Zac Efron there. Using a slang term for being high, “Zac said he was rolling,” recounts a source at the party. “He stood maybe one foot away from my face and kept saying, ‘I’ve been up for four days. I haven’t slept.’ He was running around with his shirt off. He kept talking, going a mile a minute. He said something like he’d been on a party train.”

Until recently that train had been careening out of control – even if few outside of his inner circle knew the extent of the carefully guarded actor’s wild nights, which sometimes turned into days. “He would party behind closed doors,” says a pal of Efron’s. “He wouldn’t be out of control in public, ever.” But the 25-year-old High School Musical star – just 17 when he was cast in the Disney Channel phenomenon, catapulted from his Arroyo Grande, Calif., high school theater class to tween idol – finally hit the brakes a few months ago. Multiple sources confirm to PEOPLE that he completed rehab. Other sources say he had a serious drug problem that included abuse of cocaine and Molly, a form of Ecstasy. (A rep for Efron declined to comment for this story.) Efron went to rehab early this summer, according to a source who has worked with him. By the time Efron hit the Toronto Film Festival on Sept. 5 to promote his drama Parkland, “he wasn’t partying at all and called it an early night,” says a friend who was with him there. “He looked good; he was doing really well.”

What happened to Efron – and how did he keep his troubles under wraps? An A student tight with his engineer dad and secretary mom, he launched his career as a squeaky-clean boy next door, but as the High School Musical series took off, so did the lifestyles of many of its young stars. “Things changed when the second movie happened,” says a HSM source. “The dynamic was different” as he, costar Vanessa Hudgens, now 24 – whom he dated from 2005 to 2010 – and their castmates tested out the L.A. party scene. Meanwhile Efron transformed himself from a slight teen into a chiseled heartthrob, striving to evolve past his teen-idol persona. “He wants to be that next Leonardo DiCaprio,” says JR Garcia, a friend since elementary school. “He’s really tried to build his portfolio into something different.” But when some of his projects failed to ignite, he struggled with insecurities about his looks and career, say several sources, and appeared uncomfortable at a press conference in Toronto when he was asked about negative reviews for his Parkland performance. “I don’t know how else to go about [acting],” he said. “My goal has always been to continue to challenge myself.”

Unlike many of his Hollywood peers, the affable star – “He’s Mr. Charming,” says a source who has been to parties with Efron – maintained a scandal-free public profile: no DUIs, no sloppy nightlife behavior and, until recently, no rumblings of trouble on-set. “I care too much about those around me and everything I’ve worked for to just go and blow it,” Efron told PEOPLE in March 2012. “Some people can handle [partying] and some can’t.” But he eventually began far out-partying his peers, falling in with a clique of young Hollywood clubbers who often used drugs, according to sources. On a trip to Las Vegas in 2010 with friends, he and some buddies headed to a strip club as soon as Hudgens left for a New York photo shoot. “They were snorting coke and pulled an all-nighter at the strip club,” says a source who was with them. “They came straight from the strip club and went to a pool party at, like, noon.”

By early this year, his partying had escalated into self-destruction. Three separate sources who have spent time with the actor say they witnessed Efron doing cocaine during the past year. “He was out every night but very discreet about it,” says a friend who has attended parties with him. But when he was away from prying eyes, “his friends would joke that he was like a mini Charlie Sheen,” says the friend. “People would go home [from a club] around 4 a.m., and he’d go to an afterparty. Then he’d keep the party going until 5 p.m. the next day.”

Eventually his hidden life and his professional one began to collide. While promoting The Lucky One in 2012, “he would party and then realize he had press the next day, and in the morning he would take Adderall,” says a source in Efron’s inner circle. Last spring, when he shot Neighbors in L.A., “people on-set thought he was [acting] weird,” says a production source, who denies reports Efron’s behavior caused delays. Another friend says that was when his problem was at its worst. “He was glassy-eyed, sweaty and would have a lot of late nights. He didn’t look good at all.”

Not long after, Efron entered rehab. “The partying got out of hand,” says the friend. “He cares so much about his career.” In recent weeks Efron celebrated getting out of rehab with a trip to Peru with his father. While Efron is expected to begin filming the thriller Autobahn with Amber Heard in Germany in the next few months, he’s getting plenty of support from all over Hollywood. “The fact that he’s seeking help only says great things about him,” says Parkland costar Marcia Gay Harden. “I think only a coward lives in denial, and Zac is not a coward.”