We determined the prevalence and risk factors for nosocomial infection at Hassan II University Hospital and the causative microorganisms among 282 inpatients. The mean duration of hospitalization was 16.4 (SD = 15) days. The prevalence of nosocomial infection was 6.7%. Infections at the site of the operation were the commonest. No catheter-related infection was noted. The main organisms isolated were Escherichia coli, Klebsiella pneumoniae and Candida albicans. The occurrence of a nosocomial infection was significantly associated with surgical operation (P = 0.005), presence of urinary catheter (P = 0.002) and length of hospital stay greater than 3 weeks (P = 0.04).