California Penal Code Section 12251

It shall be a public nuisance to possess any machinegun in violation of this chapter, and the Attorney General, any district attorney or any city attorney may bring an action before the superior court to enjoin the possession of any such machinegun. Any such machinegun found to be in violation of this chapter shall be surrendered to the Department of Justice, and the department shall destroy such machinegun so as to render it unusable and unrepairable as a machinegun, except upon the filing of a certificate with the department by a judge or district attorney stating that the preservation of such machinegun is necessary to serve the ends of justice.