SACRAMENTO, Calif. — A video of a black boy being detained while Sacramento police put a spit hood over his head went viral this week, prompting police officials to defend the officers' actions.

The family’s attorney, Mark T. Harris, said in a video post that the 12-year-old was at a neighborhood carnival when he was chased out by a security officer and later detained. That’s where the now-viral video shows Sacramento Police officers putting a “spit mask” over the boy’s head.

“We will not tolerate our community, and particularly our young people, being treated in the way this man was treated,” Harris said in the video. “We want to make sure that the greater Sacramento community, the state of California and the world is aware of what happened to this young man who was trying to do nothing more than enjoy the benefits of a neighborhood carnival.”

READ ALSO:

Many in the community spoke out on social media about the moment in the video where a spit hood was placed over the boy's head. Sacramento Police Sgt. Vance Chandler told ABC10 the “spit mask” was used for a specific reason and that it causes no harm to the person wearing it.

"The juvenile spit in the face of our officer multiple times," Chandler explained. "And a spit mask was put on the juvenile. We want to make sure that our entire community knows what a spit mask is.”

Chandler explained that the mask has an elastic neck that allows for fast and easy removal. Police say the person can see and breathe through it and that the mask is meant to protect officers from bodily fluids.

READ ALSO:

Chandler told ABC10 the boy was ultimately released to his mom after being cited for battery on an officer and resisting police.

Sacramento police are reviewing the incident and are expected to release body camera video from officers on the scene.

"Our police department, we don't want to be in this position,” Chandler said. “The people involved, they don't want to be in this position. So, we look at this and we stay committed to finding ways to make sure that we do all we can do to prevent this from happening again.”

Continue the conversation with Chris on Facebook.

(Editor's Note - This story has been updated to clarify the use of what is commonly refereed to as a "spit hood" and what police call a "spit mask.")

WATCH ALSO: Man files suit against City of Sacramento, police after violent 2018 arrest