Deputies have arrested a man they say arranged to meet a 12-year-old girl online and was caught in her home.

Carlos Ramirez, 24, traveled to the girl's home on the 3100 block of 9th Street E at about 2 a.m., according to the Manatee County Sheriff's Office.

Detectives said Ramirez and the girl met on Facebook two weeks ago, and that they were texting each other back and forth. On Wednesday, detectives said the girl texted him and asked him to come over.

Even though Ramirez knew the girl was 12, he went over to her house, detectives said. He was in her bedroom for about an hour when the girl's grandmother walked in.

Deputies said the grandmother called 911 and, along with family members, proceeded to hit Ramirez. When a deputy arrived at the home, he said Ramirez ran out of the house, saying, "I'm getting killed."

Detectives said both the girl and the suspect say nothing sexual happened while they were in the house together, and they were only talking.

Ramirez was charged with traveling to meet a minor for unlawful sexual activity.

The investigation continues.