The dispute began on Tuesday in Anaheim when an un-uniformed officer grabbed a 13-year-old boy walking across his lawn, accusing him of making a threat.
Footage of the incident shows two other youths shove and punch the officer, who pulls a pistol from his waistband.
About 300 people took to the streets of Anaheim on Wednesday night.
Several windows were smashed on homes during the rally, police said.
Some 24 people were arrested, including eight women and six juveniles, according to the Los Angeles Times.
Anaheim police told the newspaper the dispute arose from "ongoing issues" with young people walking across the officer's property.
During the ensuing argument, the LAPD officer detains the 13-year-old, whom he says threatened to shoot him.
The boy insists he only threatened to "sue" him, and accuses the officer of directing an obscene epithet at one of the girls in the group, which the man denies.
"Let me go," the boy says repeatedly.
During the stand-off, a group of young people stand by, telling the man to release him.
One of the young onlookers shoves the officer over a hedge and another throws a punch at him.
The man, still holding on to the 13-year-old, pulls a pistol and a single gunshot rings out, though it is not clear if he fired deliberately.
Police arrested two of the boys, but not the off-duty officer.
A 13-year-old faces charges of battery and making criminal threats.
A 15-year-old was detained on suspicion of assault and battery.
The off-duty officer has been placed on administrative leave, pending an inquiry.
An Anaheim woman, who claims to be the 13-year-old's mother, described the video on Facebook as "devastating" and "disturbing".

It took Kenya 140 tournaments to break their duck and they are only the second African nation after South Africa to win a World Series leg.
Kenyan president Uhuru Kenyatta said on Twitter: "Join me in congratulating the Kenya Sevens Rugby Team on their remarkable win."
Rugby Sevens will feature for the first time in this summer's Olympics in Rio.
Kenya, who have qualified for the Olympics in the men's and women's event, opened up a 20-0 half-time lead over the favourites with two of their four tries from Collins Injera.
Fiji, coached by former England Sevens coach Ben Ryan, briefly rallied after the break, but Kenya held firm and scored two further tries to seal a convincing win.
Kenya have shot up to seventh in the standings after their 22-point haul in Singapore, with Fiji extending their lead at the top to eight points over South Africa with two rounds remaining in France and England.
South Africa, beaten narrowly by Fiji in the semis, finished third after thrashing Argentina 28-0.
Samoa landed the second tier Plate title after causing another upset in beating New Zealand, Scotland edged United States to land the Bowl and Russia crushed Wales to win the Shield.
Have you added the new Top Story alerts in the BBC Sport app? Simply head to the menu in the app - and don't forget you can also add alerts for your rugby union team, cricket scores, football and more.

McMahon, 27, can also be deployed in an attacking midfield role.
An employment tribunal recently ordered Portadown to pay £7,000 in unpaid wages to McMahon, an outcome the Shamrock Park club say they will appeal.
In June, an Irish FA disciplinary hearing ruled that McMahon had been paid while registered as an amateur.
The registration case led to a 12-point penalty being handed down to the Ports, a decision which they are also in the process of appealing.
Swifts head coach Rodney McAree described McMahon as "a wonderful talent".
"The fact the Swifts play good football really made me want to join the club. I watched last season and anytime I saw them play I thought 'they play the game the right way' and that has attracted me to the club without a doubt," McMahon told the Dungannon FC website.
Dungannon lie fifth in the Premiership table and travel to Seaview to face champions Crusaders on Saturday.
Hundreds of protesters have taken to the streets of a Los Angeles suburb after an off-duty policeman fired a gun during a fracas with teenagers.
[NEXT_CONCEPT]
Kenya shocked Fiji 30-7 in the final of the Singapore Rugby Sevens to claim their first World Series title.
[NEXT_CONCEPT]
Dungannon Swifts have completed the signing of former Portadown and Bohemians forward Peter McMahon on a one-year deal.