An 11-year-old Arizona girl thwarted a possible kidnapping last week after she demanded a stranger who told her to get into a white SUV to give her a “code word.”

The unidentified girl and a friend were walking near a park in North Pecan Creek just before 4 p.m. Wednesday when a man driving a white SUV, described as a Ford Explorer-like vehicle, pulled up next to them, Pinal County Sheriff’s Office said in a statement.

The man claimed the girl’s brothers were in a serious accident and told the girl she had to come with him, police said. The girl asked the stranger for a “code word” — but the man didn’t know the answer and fled the scene.

"We came up with a code word, and this one time, it saved my daughter's life," the girl’s mother, Brenda James, told FOX10 Phoenix. "She told me that a guy tried to take her.”

James said she never thought her daughter would have to use the “code word” tactic.

"I never thought it would be used, but I'm proud of her for remembering that and knowing to use that," she said.

Other children in the neighborhood said the SUV circled the park several times before stopping at the 11-year-old girl. The driver covered the majority of his face while talking to the child to conceal his identity, FOX10 reported.

Pinal County Sheriff Mark Lamb applauded the girl’s parents for speaking to their children about “stranger danger.”

“Kudos to the parents of this child for having a code word and talking about to their children about stranger danger,” Lamb said in a statement. “We hope by putting this out, it will encourage parents to have that conversation and create a plan with their children, so they know what to do if they are in that situation.”

The man was described as an individual in his 40s with a short beard.