The aim of this study was to analyze the trend in infant mortality rates in the State of Rio Grande do Sul, Brazil, from 1994 to 2004, in a longitudinal ecological study, by means of panel data analysis and multilevel linear regression (two levels: microregion and time) to estimate factors associated with infant mortality. The infant mortality rate decreased from 19.2 (1994) to 13.7 (2004) live births, and the principal causes of death in the last five years were perinatal conditions (54.1%). Approximately 47% of the variation in mortality occurred in the microregions, and a 10% increase in coverage by the Family Health Program was associated with a 1 reduction in infant mortality. A 10% increase in the poverty rate was associated with a 2.1 increase in infant deaths. Infant mortality was positively associated with the proportion of low birthweight newborns and the number of hospital beds per thousand inhabitants and negatively associated with the cesarean rate and number of hospitals per 100 thousand inhabitants. The findings suggest that individual and community variables display significant effects on the reduction of infant mortality rates.