OBJECTIVE: To assess a new impunity index and variables that have been found to predict variation in homicide rates in other geographical levels as predictive of state-level homicide rates in Brazil. METHODS: This was a cross-sectional ecological study. Data from the mortality information system relating to the 27 Brazilian states for the years 1996 to 2005 were analyzed. The outcome variables were taken to be homicide victim rates in 2005, for the entire population and for men aged 20-29 years. Measurements of economic and social development, economic inequality, demographic structure and life expectancy were analyzed as predictors. An "impunity index", calculated as the total number of homicides between 1996 and 2005 divided by the number of individuals in prison in 2007, was constructed. The data were analyzed by means of simple linear regression and negative binomial regression. RESULTS: In 2005, state-level crude total homicide rates ranged from 11 to 51 per 100,000; for young men, they ranged from 39 to 241. The impunity index ranged from 0.4 to 3.5 and was the most important predictor of this variability. From negative binomial regression, it was estimated that the homicide victim rate among young males increased by 50% for every increase of one point in this ratio. CONCLUSIONS: Classic predictive factors were not associated with homicides in this analysis of state-level variation in Brazil. However, the impunity index indicated that the greater the impunity, the higher the homicide rate.