A video showing police officers and a private security guard in Sacramento, California, handcuffing a 12-year-old boy and placing a "spit mask" over his head has led to outrage among many viewers on social media.

In the video, which was posted earlier this month on the Black Lives Matter Sacramento Facebook page and shared by the boy's mother, La'toya Downs, several city police officers and a security guard are seen placing handcuffs on the child, who is black.

A security guard, who said in the video he works for Paladin Private Security in Sacramento, is heard telling the boy to "stop resisting" as the handcuffs are placed on him. When a female police officer asks the guard what the boy did, he says the child was trespassing and trying to get people to buy things for him at a nearby Walgreens.

Paladin Private Security did not immediately return NBC News' request for comment.

Attorney Mark T. Harris said he is representing the family and identified the child in the video as Isaiah. Harris told NBC News that the incident happened April 28 as Isaiah was attending a carnival with his sister and friends.

Harris said an adult chaperone asked Isaiah to get change from his car in the parking lot when the security guard approached the child and accused him of stealing from the vehicle. The security guard also falsely claimed Isaiah was asking people to buy him things at Walgreens, Harris said.

“Isaiah was not doing any of that," Harris said in a phone interview Wednesday. "He was attending the carnival with his family. Isaiah wasn’t near the Walgreens when this happened.”

Harris said Isaiah tried to explain to the security guard what he was doing at the car and started to run away when the guard demanded Isaiah give him the car keys.

In the video, which had been viewed more than 241,000 times as of Wednesday morning, a man filming asks officers why the child's parents had not been called.

The situation escalates when police officers start walking Isaiah toward a squad car. At one point in the video, the security guard appears to put his arm around Isaiah's head as he struggles against the officers. The man filming yells at the guard to let go of the child.

A female officer is also heard asking Isaiah if he spit on her. "Yeah, I spit on you. How you like that?" he replies.

When backup arrives, a male officer places a white mesh hood, called a spit mask, over Isaiah's head as a crowd which gathered around the boy yells for officers to remove it.

In a press release Wednesday afternoon, the police department said the spit mask was used "on the subject to prevent him from spitting" on officers.

“Our officers involved in this incident appropriately used a spit mask to protect themselves and defuse the situation," Chief Daniel Hahn said in the press release. "I am grateful that our officers were willing to proactively intervene when they observed suspicious activity, and that nobody was injured during this encounter.”

According to the website Spit Sock Hood, which sells the masks, they are made from lightweight material and are used by law enforcement "to prohibit the transfer of saliva."

A police spokesman told CBS Sacramento that using a spit bag is standard operating procedure. Asked if the child's age in this case would be a factor in whether to use the mask, the spokesman responded: “Well, all that plays a factor, all the circumstances that they faced during this incident, all those play a factor."

Harris told NBC News he has never heard of police using a spit mask on a person they were detaining and said it was "ridiculous" officers used it on a child.

In police body camera video released by the department Wednesday afternoon, Isaiah tells officers he can't breathe and repeatedly asks them to remove the mask. The officer tells Isaiah she's not going to take the mask off him. The boy is placed in the squad car with the spit mask still around his head.

Sacramento police said Isaiah was not arrested, but was cited for battery against a police officer and resisting officers. He was eventually released to his mother.

The police spokesman declined to release the names of the officers involved and said they were not being investigated because they "followed protocols." According to the Sacramento Bee, police are reviewing the incident.

Harris called the officers' conduct "deplorable" and said the family is asking for an apology from the department and is also considering filing a lawsuit.

A Walgreens spokesperson told NBC News the company would look into the incident.

NBC News also reached out to the mother, who did not immediately respond.