In several studies on patients with bloodstream infection (BSI), prior use of statins has been associated with improved survival. Gram-positive and Gram-negative bacteria alert the innate immune system in different ways. We, therefore, studied whether the relation between prior statin use and 90-day total mortality differed between Gram-positive and Gram-negative BSI. We conducted a prospective observational cohort study of 1,408 adults with BSI admitted to Levanger Hospital between January 1, 2002, and December 31, 2011. Data on the use of statins and other medications at admission, comorbidities, functional status, treatment, and outcome were obtained from the patients’ hospital records. The relation of statin use with 90-day mortality differed between Gram-negative and Gram-positive BSI (p-value for interaction 0.01). Among patients with Gram-negative BSI, statin users had significantly lower 90-day total mortality [odds ratio (OR) 0.42, 95 % confidence interval (CI) 0.23–0.75, p = 0.003]. The association remained essentially unchanged after adjusting for the effect of sex, age, functional status before the infection, and underlying diseases that were considered confounders (adjusted OR 0.38, 95 % CI 0.20–0.72, p = 0.003). A similar analysis of patients with Gram-positive BSI showed no association of statin use with mortality (adjusted OR 1.22, 95 % CI 0.69–2.17, p = 0.49). The present study suggests that prior statin use is associated with a lower 90-day total mortality in Gram-negative BSI, but not in Gram-positive BSI.