Layleen Cubilette-Polanco, the transgender Rikers Island inmate found dead in her cell in June, died due to complications from epilepsy, officials announced.

Polanco, 27, died naturally last month as a result of “[s]udden unexplained death in epilepsy,” the Office of the City Medical Examiner revealed late Tuesday.

“Genetic testing on this decedent showed a biological mutation in the CANNA1H gene which is the likely cause of her epilepsy; variants in this gene are associated with seizures,” said Chief Medical Examiner Dr. Barbara Sampson in a statement released to the media.

Polanco was discovered in her cell at Rikers’ Rose M. Singer Center on June 7, while she was being held in solitary confinement, a Department of Corrections spokesperson previously said.

She was jailed when she was unable to make $500 bail for charges related to an arrest on April 13, at which time she also had an open warrant.

David Shanies, an attorney who represents the Polanco family, previously acknowledged that Layleen suffered from epilepsy, but told The Post she also had bruises on her face at the time of her death.

Shanies Law Office wrote in a tweet Tuesday night that it had received “documentary confirmation that Layleen’s epilepsy was well known to DOC, and she suffered multiple seizures on Rikers.”

“On 5/30, a jail doctor approved her placement in punitive segregation, despite her epilepsy,” the tweet continued. “That became her death warrant.”