The Stockton Police Department is coming under fire after a video was posted on YouTube showing nine officers forcibly arresting a 16-year-old boy accused of jaywalking, and the teen’s family filed a formal complaint Thursday.

The video begins after the initial confrontation, just before 7 a.m. Tuesday, when witnesses said a single officer told the teen to walk onto the sidewalk and not in the bus-only lane in the Northern California city. The incident escalated and the video begins with the boy sitting on the edge of a planter with the officer over him, baton drawn.

Witnesses can be heard yelling at the officer, who calls for backup.

Eight additional officers quickly arrive and several of them forcibly put the teen on the ground together and arrest him.

The video was posted by witness Edgar Avedaño, who gave his version of the incident on his Facebook page.

“Here's the info of what happened,” he wrote. “The kid got stopped for ‘jaywalking’ when he barely stepped out of the bus he was 2 feet away from the sidewalk when the cop stopped him for ‘jaywalking’. The cop was telling him to take a sit but the teen kept walking to his bus but the cop kept grabbing his arm & the kid took off the cop's hand off his arm so the cop took out his baton & that's when I started recording because everything happened too quick. He didn't have to hit the kid with the baton & no need to call about 20 cops. And as you can see his body cam is on the floor. Smh” (sic)

The police department contends the detainment and arrest was within policy guidelines.

Officer Joseph Silva, a spokesman, said the teen did not comply with the officer’s request that he stop walking in a bus-only lane and cursed at the officer in reply. He continued walking in the street, Silva said.

Silva said that a struggle ensued, and the teen knocked the officer’s body camera to the ground and tried to grab his baton. The officer requested backup, and asked for additional officers because of the crowd that was forming.

"If everyone would just learn to comply with the lawful orders from police officers and not try to hold or grab any of our weapons, force would never have to be used," Silva said.

The teen was cited for trespassing and resisting arrest, Silva said.

An initial review indicated that the officers acted within policy, he added, but there would be additional investigation.

NBC Investigations' Andrew Blankstein contributed to this report.