This paper develops a dynamic equilibrium model of crime with heterogeneous agents and human capital accumulation. Agents decide whether to commit crimes by comparing potential gains to the expected punishment. Public security policies are defined as pairs of a size of the police force and an average sentence length. We propose a micro-founded police technology linking expenditures to the probability of apprehension. The structural model, estimated using US data, is used in an unprecedented evaluation of the global optimality of public security policies and in an equilibrium analysis of the potential complementarities across public security and educational policies.