Inset: Ricardo Perez Castillo appears in a booking photo (Kent County Sheriff's Office). Background: The gated community where the defendant stabbed an 11-year-old girl on June 15, 2024 in Kent County, Mich. (Google Maps).

A Michigan man will spend several decades behind bars for a "completely random" attack where he broke into a house and repeatedly stabbed an 11-year-old girl during a sleepover.

The man simply walked into the home, went upstairs, found the two girls sleeping, and attacked, as Law&Crime previously reported.

In October, Ricardo Perez Castillo, 25, pleaded no contest to one count each of assault with intent to murder, home invasion in the first degree, and assault with intent to commit criminal sexual conduct in the second degree, according to the Kent County Prosecutor's Office.

When he was initially arrested last year, the defendant also faced one charge of carrying a weapon with unlawful intent.

On Wednesday, the former Marine Corps recruiter was sentenced by 17th Circuit Court Judge Christina Mims to 40 years in prison.

Love true crime? Sign up for our newsletter, The Law&Crime Docket, to get the latest real-life crime stories delivered right to your inbox.

The sentencing hearing was not shy of drama, according to a courtroom report by Grand Rapids-based ABC affiliate WZZM.

"This case is disturbing on so many levels," Mims told Castillo. "It's disturbing that you would go into these people's home, that you didn't know, that you would arm yourself in their home, that you would almost kill a child who was only trying to sleep over with her friend."

The underlying incident occurred on June 15, 2024, when Castillo broke into the kitchen of a house on Ella Terrace Court just before 3 a.m. There, while covered in a "large amount of blood," the defendant grabbed a kitchen knife and attacked the friend of the homeowner's daughter "multiple times," Kent County Undersheriff Bryan Muir told Grand Rapids-based Fox affiliate WXMI. The homeowner's daughter, for her part, was not physically hurt during the harrowing attack.

At first, the crime was an absolute mystery to law enforcement.

"Right now, we believe this is a completely random act and there's no connection to the residence or the family whatsoever and that's obviously one of those case facts that's concerning to us," the undersheriff told Grand Rapids-based NBC affiliate WOOD at the time of the arrest – adding there was "nothing to connect the suspect" to the residence he entered or the people inside of the house.

Later, the strange nature of the case grew increasingly macabre.

Castillo allegedly planned to kill the girl "and then have sex with her dead body," according to court documents obtained by Kalamazoo-based CBS affiliate WWMT and WZZM.

During the sentencing hearing, more shocking details were revealed.

"The egregiousness with which this defendant acted is horrendous," Assistant Prosecuting Attorney Elizabeth Bartlett told the court. "His statements right after the crime also show a complete lack of remorse. Some of his words that he used to describe what happened are unfathomable. He admitted to the detectives that he wanted to kill everyone in the home, that he armed himself in the knife for that purpose."

The since-condemned man, however, has also since changed his tune – kneeling down in the courtroom to perform his allocution.

"I ask for forgiveness," he said, according to WZZM. "I know I don't deserve it. I can't imagine all the nightmares. I can't imagine anything that you have felt for the past 15 months. But I'm sorry. I'm truly from the bottom of the heart. I was a lost person. I have found God and made me realize how much, how much I truly am lost. I ask for forgiveness for all of you, for both families, for the whole community of Rockford, I ask for forgiveness. Sorry. I'm sorry."

In court, the homeowner also spoke – dismissing the defendant's claims of alcohol-driven bloodlust, saying his daughter is always afraid, justifying his decision not to shoot Castillo, and asking the judge to impose the maximum sentence possible.

"We had to move," he said. "We've had to clean up just blood and mess. We've heard what he has wanted to do to our family and what he wanted to do to my daughter and daughter's friend, and that's just not okay. This should not be taken lightly."

The lead prosecutor read the girl's impact statement.

"I remember being in a lot of pain on the floor," the girl wrote, according to WZZM. "I remember seeing all my blood everywhere. I remember feeling warm running down my body from the blood. I remember the smell of it. I could still feel the sting of the pain. I remember being very scared and not understanding why this happened to me. I was terrified. I never would have guessed an innocent sleepover would have left me in the hospital with bad injuries."