EDITOR'S NOTE: After the publication of this story, officials at the San Mateo County district attorney's office said they wanted to clarify that "we do not believe that there was any sexual conduct by Mr. Jaffer that evening and for this reason we dismissed the sexual abuse charges. The physical injury charges were separately dismissed because we believe that the injuries were the result of Mr. Jaffer being in a state of unconsciousness caused by prescription medication."

Child sexual assault charges against Zainali Jaffer, founder and former CEO of tech startup Vungle, were dismissed by a San Mateo County judge on Monday.

In October, Jaffer, 29, was arrested at his Hillsborough home on suspicion of oral copulation on a child, among other charges that amounted to five felonies and one misdemeanor, after police officers allegedly witnessed him sexually abusing his son.

All charges were dismissed due to insufficient evidence, said San Mateo County Deputy District Attorney Sharon Cho.

Cho said the defense had provided medical records indicating that Jaffer suffered from undiagnosed bipolar disorder and “was taking prescription medication” that led to the incident.

At the time of his arrest, Jaffer was believed to have possibly been under the influence of LSD, San Mateo County District Attorney Steve Wagstaffe told The Chronicle, though there is no toxicology report that proves that, Cho said.

The evidence provided to prosecutors last month caused them to reevaluate the case. Ultimately, prosecutors felt they could not prove that Jaffer’s behavior was caused by “voluntary intoxication.”

“You can’t just take a hallucinogen and excuse yourself of all responsibility. In this case initially we believed that’s what occurred — that the defendant had ingested LSD and then he committed the crimes,” Cho said. “What changed was when the defense presented this information, that the act was a result not of LSD but of underlying mental illness that had never been diagnosed. Ultimately, the people have the burden of proving that’s not the case, and when we reevaluated, we felt the evidence was not such that we could meet that burden.”

At about 4 a.m. on Oct. 15, police went to Jaffer’s home when they heard a child screaming and found Jaffer allegedly trying to force his 3-year-old son’s face into his genitals, Wagstaffe told The Chronicle last year.

“The acts that were charged, we would say occurred,” Cho said. “But that sort of misses the point, because, legally, we have to ask ourselves, what was it that caused those acts? Given the information given to us, we just can’t prove that what resulted was voluntary intoxication versus this was someone suffering from a mental breakdown and in some kind of psychosis.”

Jaffer co-founded Vungle in 2011 and was its CEO until his arrest. The San Francisco tech startup provides mobile video advertising services.

“Being wrongfully accused of these crimes has been a terrible experience, which has had a deep and lasting impact on my family and the employees of my business. Those closest to me knew I was innocent and were confident that all of the charges against me would eventually be dismissed,” Jaffer said in a statement.

Patrick Clancy, attorney for Jaffer, said: “The charges against Mr. Jaffer were the result of a serious misunderstanding by police officers who arrived on the scene when Mr. Jaffer was in the midst of having an adverse reaction to prescription medication and was, in his mind, trying to protect his son.”

Erin Stone and Roland Li are San Francisco Chronicle staff writers. Email: erin.stone@sfchronicle.com, roland.li@sfchronicle.com Twitter: @erstone7, @rolandlisf