Many people are concerned about societal cohesion in the face of higher numbers of foreigners migrating to Western democracies. The challenge for the future is to find and adopt institutions that foster integration. We investigate how the right to vote in local elections affects immigrants compliance with the law. In our study for Denmark, we exploit an institutional regulation that grants foreigners local voting rights after three years of stay. Relying on register data, we find causal evidence that the first possibility to vote considerably reduces the number of legal offenses of non-Western male immigrants in the time after elections.