In August, police said, Miranda attempted to drag a 7-year-old girl who had been playing near a house in Southeast Portland into the bushes. Police said the girl's mother heard her daughter's screams and then punched Miranda, causing him to flee.

After he ran from the scene, some people in the area then tackled and beat Miranda, who had to be hospitalized.

Miranda had no recollection of what had happened because he had been under the influence of drugs, prosecutor Don Rees said.

Before the incident, Miranda had ingested a handful of psychedelic mushrooms in a nearby park with some friends. He began saying nonsensical things to them and ran off, Rees said.

Miranda also had heroin and marijuana in his system.

"It's not clear at all that he knew what he was doing," Rees said. "He has no memory of this event."

Miranda read a prepared statement to the girl's mother, who was in the courtroom. He apologized for what he had put her and her daughter through and said he would have "all the time in the world" to think about the mistakes he had made.

"I feel horrible," Miranda said. "Please forgive me for what I did to your daughter."

Miranda said he vowed to never touch drugs again and that he never would have acted in such a way if he had been sober.

In addition to the time he will serve in the youth facility, Miranda will undergo drug treatment while in prison and after he is released. He will also be on post-prison supervision for three years following the 18 months.

Ronnee Kliewer, Miranda's attorney, said she had nothing to add to what Miranda said in his statement. She described him as "absolutely remorseful" and pointed out that Miranda had no prior criminal history.