A large body of evidence supports the concept that socioeconomic factors may influence the prognosis of cardiovascular diseases. We studied the influence of socioeconomic factors in the prognosis of heart failure in 494 patients consecutively admitted to the hospital due to worsening of symptoms of heart failure in São Paulo, Brazil. The ages ranged between 15 and 90 (mean 57.5, standard deviation 14.2) years; 345 (69.8%) were men and 149 (30.2%) were women. Patients were followed-up at least for two years after hospital discharge. Two hundred and forty-one patients died due to cardiac disease during the follow-up period. Hierarchical analysis was performed with demographic and socioeconomic variables analyzed in the first level and clinical variables in the second level. At the level of the demographic and socioeconomic characteristics, care under the Public Health System (odds ratio 3.46, 95% CI 1.91 to 6.27, p<0.001) was the most important predictive factor for mortality. At the second hierarchical level, the predictive factors of mortality were Chagas' heart disease (odds ratio 3.34, 95% CI 1.90 to 5 89, p<0.001), digoxin therapy (odds ratio 1.94, 95% CI 1.09 to 3.45, p<0.025), frequency of myocardial infarctions (odds ratio 1.75, 95% CI 1.25 to 2.44, p<0.001) and arterial hypertension (odds ratio 0.47, 95% CI 0.30 to 0.73, p=0.001). Care delivered through the Public Health System may be a marker of socioeconomic conditions related with higher mortality in patients with heart failure.