Streptococcus pneumoniae resistance to penicillin and erythromycin in relation to beta-lactam and macrolide consumption in Spain over 19 years (1979-1997) was studied from resistance data collected by a search of the literature. Antibiotic consumption was expressed in defined daily dosage (DDD)/1000 inhabitants/day. A significant relationship (P: < 0.001) between erythromycin resistance (MIC >/= 1 mg/L) and global macrolide consumption (r = 0.942), as well as between high-level penicillin resistance (MIC >/= 2 mg/L) and global beta-lactam consumption (r = 0.948) was observed. The relationship between erythromycin resistance and macrolide consumption was due mainly to consumption of macrolides taken twice a day (adjusted r(2) = 0.886). Prevalence of high-level penicillin resistance correlated with consumption of oral cephalosporins (adjusted r(2) = 0.877); however, there appeared to be no correlation of consumption of oral or parenteral aminopenicillins, narrow-spectrum penicillins or cephalosporins with intermediate-level penicillin resistance (MIC 0. 12-1 mg/L). The prevalence of high-level penicillin and of erythromycin resistance were also strongly correlated with each other (r = 0.903, P: < 0.001). In addition to global consumption, different categories of resistance (high or intermediate), and the differential capability of antibiotics to select resistance, must be taken into account when studying antibiotic impact on bacterial populations. Although this ecological analysis is not able to demonstrate a causal relationship between antibiotic consumption and development of resistance, it suggests that overuse of certain specific antibiotics is more likely to be related to the increase in drug-resistant strains of S. pneumoniae.