Protests have erupted in the US city of Anaheim after a video circulating on social media captured the moment an off-duty police officer fired a shot after pulling a gun on a 13-year-old boy and other teenagers.

The footage, recorded on Wednesday, shows the officer in civilian clothes dragging the boy, who demands the man release him.

The 13-year-old, later identified by his parents as Christian Dorscht, challenges the man to produce evidence that he is an officer, which he refuses to do.

As the confrontation escalates, some of Dorscht's friends, attempt to physically free him from the officer's clutch, at which point the man pulls a pistol from his belt and fires a shot, prompting a gathered group of Latino and black teenagers to flee.

Make this go viral. Man claiming to be a police office violently grabs a Chicano boy and fired shots at other kids around him. Disgrace. pic.twitter.com/xKJ7lo9MPX — . (@_javiier43) February 22, 2017

At the end of the video, a uniformed police officer arrives at the scene but it is not clear whom he arrests.

Local reports later said Dorscht and another teen were arrested following the confrontation.

The incident is believed to have started after the officer accused the teenagers of walking on his lawn.

The Los Angeles Police Department, or LAPD, to which the unidentified officer belonged, said it was investigating the incident, in a statement published Thursday.

"[Investigators] are aware there is a video of the incident and will review all video in this case,” the statement said, adding: "The officer is currently on administrative leave."

The confrontation provoked an angry reaction on social media, with many accusing the police of racism for its perceived failure to punish the officer involved.

@AnaheimPD we demand that you arrest that cop. Brown lives matter more than the green lawns of racist cops. #Anaheim — Adal C. (@Adal_Corres) February 23, 2017

Dozens of people in Anaheim protested against police brutality overnight on Wednesday with some attempting to march on the officer’s home.

Police officials there said 24 people were arrested for "misdemeanour charges including failure to disperse".

In July 2012, protests erupted in Anaheim after the killing of 25-year-old Manuel Angel Diaz, a Latino man who was unarmed at the time.

No criminal charges were filed against the officers responsible and a civil jury later cleared the pair of charges of using excessive force.

The issue of excessive force used by police forces, especially against people of colour, is one of the key drivers of the Black Lives Matter movement.