Aims. To investigate drug use relative to mental functioning and to explore the use of inappropriate drugs and potentially harmful drug combinations in nursing home residents. Methods. Cross-sectional study in 15 nursing homes (1042 long-term care residents) in Bergen, Norway. Information on individual patients' scheduled drug use was obtained from drug dispensing cards. Mental functioning was assessed by means of the Clinical Dementia Rating scale. Drug use was considered inappropriate according to approved expert consensus criteria. Drug-drug interactions were considered relevant according to the national standard. Classification of interactions was based on pharmacokinetic and pharmacodynamic principles. Results. Mentally intact residents used significantly more scheduled drugs than the mentally impaired (mean 6.2 vs 4.8, P<0.001). The mentally intact used generally more of all types of drugs, in particular hypnotics, cardiovascular and pain-relieving drugs. Of all drug users, 25.3% received inappropriate medications, comprising 6.2% of all drugs issued. Fewer mentally impaired residents received inappropriate drugs (21.6% vs 44.2%, P<0.001). Of the residents, 95 received 101 potentially harmful two-by-two drug combinations (1.9% of all prescriptions). The number of drugs used was weakly associated with inappropriate drugs (r=0.33, P<0.001) and with potentially harmful two-by-two drug combinations (r=0.27, P<0.001). Conclusion. The study shows considerable differences in drug use between mentally impaired and mentally intact nursing-home residents that may only partly be explained by a diagnostic selection effect. Mentally impaired residents are at greater risk of not receiving appropriate treatment for their complaints, but they are also less liable to suffer from hazards caused by inappropriate drugs.