WOODBRIDGE, Va. - A Woodbridge father showed up to his daughter's elementary school to surprise her for her birthday. However, for 8-year-old Aniya Williams, it’s a birthday she will remember, but for all the wrong reasons.

“I started passing out cupcakes, doing all the meet and greets and then I see three officers come in,” said Aniya’s father, Justin. “I didn't know what was going on. They approached me [and said], ‘Are you the sexual offender?’ I'm like, ‘Whoa, what are you talking about?’”

Justin Williams said the mix-up happened in the middle of River Oaks Elementary School's cafeteria.

Prince William County police arrived at the school after Williams showed identification to a school employee and his name produced an alert.

“Then they said, ‘You're the sexual offender from Washington State,’” Williams explained to FOX 5. “I've never been to Washington state. I said, ‘Can we step outside? There's a lot of kids right here.'"

The conversation between Williams and police moved to the hallway.

“I gave them my ID, name came back clear,” said Williams. “They were looking for Justin L. Williams. My name is Justin Benjamin Williams. He's 6'1,” 250 [pounds]. I'm 5'6,” maybe 190 [pounds].”

Aniya’s father said he was detained for more than an hour by county and then state police and the surprise birthday celebration was ruined.

“My kids are in the school crying,” said Williams. “All the other kids [are wondering], ‘What's happening? What did your daddy do? Is he a murderer? What did he do?’ Embarrassing my kids, humiliating me.”

Prince William County police say they were contacted by the school, responded and it was determined Williams is not a registered sex offender.

A Prince William County Public Schools spokesperson said, "It appears that a computer system in place to protect our students inaccurately flagged a parent as possible offender. Police were called and reportedly asked the parent to talk with them. The error was quickly found, but unfortunately not before the incident upset the student."

“I would like to see some type of justice,” said Aniya’s grandfather, Justin Jr. “If he got humiliated in public at the school, maybe there should be an apology in public just to clear it with her classmates and the staff and administration.”

The school district spokesperson said, "We deeply regret that this happened and will be investigating the situation to make sure it does not happen again. The principal immediately apologized to the family, and I echo that apology on behalf of Prince William County Public Schools.”

The spokesperson goes on to say, "We regret that the family had this experience and hope they will understand that it began with a system in place to safeguard our students."

That system is now part of the investigation as administrators determine what went wrong.

Police say they have a right to detain someone until it is deemed that it is not a criminal matter.