A police detective in Illinois was facing disciplinary action this week after being caught on camera telling a teenager he was being detained because he was white.

The video shows Detective Esteban Gomez making the comment while questioning five teenagers outside a pawn shop in Lake Villa, Ill., regarding a theft investigation, police said.

Gomez has since been disciplined for acting “inappropriately and unprofessionally,” Lake Villa Police Chief Craig Somerville said Tuesday, the Lake County News-Sun reported.

“Detective Gomez admitted his words were poorly chosen and insensitive, and he immediately regretted what he had said,” Somerville said in a statement, the paper reported.

Dezi Baczek, 18, who posted the video on Facebook, told the News-Sun that Gomez had approached her and her friends as they exited the pawn shop, and ordered them to sit on the curb or be arrested.

In the post, Baczek says the group included “someone who got into trouble,” but contends that the others “didn’t know anything about it till that point.”

In the video, a member of the group asks Gomez if he is being detained because he is a teenager or because he is wearing baggy pants.

It’s “because you’re white,” the detective responds.

“Detective Gomez has been disciplined for behavior unbecoming an officer. He will be assisting me with speaking to the parents and teens involved in this incident,” the chief said in a statement, the paper reported.

Since being posted online, the video has received nearly 50,000 views and more than 500 shares.