A 9-year-old Florida boy has been charged with attempted murder in the first degree after he allegedly stabbed his 5-year-old sister, police said.

Police responded to a report of a stabbing at the Berkeley Pointe Apartments complex in Ocala on Monday. Upon arrival, they found a 5-year-old girl with multiple stab wounds, Ocala police said.

The children's mother had called police to report her son had stabbed her daughter and fled on foot, according to an arrest affidavit. The mother said she had left her children in their apartment for about 10 minutes while she went to buy candy for them and to check the mail. When she returned, she told police she observed her son stabbing her daughter in his bedroom. She said she asked him what he was doing, grabbed the knife from him, and she picked up her daughter and took her into the bathroom as her son ran out of the apartment.

A short time after, the 9-year-old was found hiding in a maintenance shed on the property, according to police.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The 5-year-old was alert, able to communicate and flown to a nearby hospital. She is hospitalized and in stable condition, an Ocala police department spokesman said Wednesday.

NBC News is not naming the suspect because of his age.

When interviewed by police and asked why he stabbed his sister, the boy stated that he wanted to kill her and that the thought had entered his head two days earlier, according to the arrest affidavit.

"He stated that he tried to get it out of his head but could not," the affidavit says.

The boy said the two were in the apartment alone, while his mother was gone for a short time, the affidavit states. The 9-year-old said he went to the kitchen, got a knife and entered a bedroom with the knife behind his back, according to the affidavit. He said he approached his sister, grabbed her by the back of her neck and began stabbing her, the affidavit states. He also allegedly told police his sister was on roller skates and bent over attempting to show him something on the floor.

Asked a second time why he stabbed his sister, the boy stated that he wanted to be able to go outside, the affidavit says.

Police recovered a knife in the hallway at the apartment complex that appeared to have blood on the blade.

The Marion County Clerk of Courts and Florida Department of Juvenile Justice said they could not comment on the status of the case because of the suspect's age. The county's public defenders office did not immediately return a request for comment.