Teen actor Tyler Sanders, best known for his starring role in «Just Add Magic: Mystery City» and guest appearances on «9-1-1: Lone Star» and «Fear the Walking Dead,» died in June of «effects of fentanyl,” according to his autopsy.

A friend found 18-year-old Sanders «unresponsive in bed in his locked apartment» on June 16, according to the Los Angeles County Medical Examiner’s report obtained Thursday by NBC News.

The report says 911 was called and paramedics responded to the apartment where Sanders was pronounced dead.

Tyler Sanders.Tylermsanders via Instagram

“The friend had been texting with him the night before and reported using fentanyl,” the autopsy said. «Drug paraphernalia was identified at the scene.»

Toxicology tests determined that Sanders had the potent drug in his system, according to the autopsy.

“Fentanyl…is a synthetic opioid, which is approximately 50 to 100 times more potent than morphine,” the autopsy said.

Sanders’ death was determined to be an accident, according to the autopsy, dated Dec. 5 and signed by Robyn Parks, the acting medical director and medical examiner.

The report said Sanders «had a history of drug use.»

Sanders’ agent, Pedro Tapia, confirmed Sanders’ death in a June statement: “Tyler was a talented actor with a bright future. He comes from a wonderful family and we ask that you respect his privacy at this time.»

Tapia could not immediately be reached for comment Thursday. Relatives of Sanders could not be contacted either.

Sanders appeared as Leo in Amazon’s «Just Add Magic» in 2019 and brought the character back for the show’s 2020 spinoff, «Just Add Magic: Mystery City.»

He also had a guest-starring role in 2017 on AMC’s survival drama «Fear the Walking Dead,» playing the younger version of Jake Otto, and in 2018 on ABC’s crime drama «The Rookie.»

His appearance on “9-1-1: Lone Star” aired in April.

Gina Vivinetto Y Madelyn Urabe contributed.