A US police officer has been charged with murder after shooting a 12-year-old boy in the back.

Philadelphia prosecutors said Monday that the child first shot the police officer's car in early March.

However, the boy had already dropped the gun when Mendoza opened fire.

According to prosecutors, Mendoza was on a surveillance operation with three other plainclothes colleagues in an unmarked car.

They became aware of the boy and another young person.

When they turned on the blue lights, the child fired, but then threw the gun away and tried to flee.

A colleague of Mendoza fired a shot without aiming.

Mendoza himself shot the child three times, the last shot being fatal.

According to prosecutor Larry Krasner, video footage of what happened was "very difficult to view."

The policeman knew that the boy "no longer had his gun and could no longer harm him" and shot him anyway.

The police officer was dismissed from duty last month and arrested on Sunday.