Background: Early and accurate diagnosis of acute infection has important consequences for antibiotic stewardship, resource allocation, and clinical outcomes. However, limited sensitivity and specificity of current diagnostics lead to the erroneous prescription of antibiotics. Host-response-based diagnostics have the potential to address these challenges, but accuracy varies widely across heterogeneous global patient populations. Methods: We performed a multi-cohort analysis of 4,200 unique samples across 69 retrospective blood transcriptome datasets from 20 countries. These samples were collected from patients with acute bacterial or viral infections representing a broad spectrum of biological (age, sex, race, ethnicity, pathogen, host genetics), clinical (severity, day of presentation), and technical (Affymetrix, Agilent, Illumina) heterogeneity. We also enrolled patients with infectious diseases in two cohorts from Laos and Nepal. Findings: Current host-response-based gene signatures distinguished intracellular bacterial infection from viral infections with substantially lower accuracy. Using 69 datasets, divided into training and validation datasets, we identified an 8-gene signature that distinguished intracellular or extracellular bacterial infections from viral infections with an area under the receiver operating characteristic curve (AUROC) >0.91 (85.9% specificity, 90.2% sensitivity). In two prospective cohorts from Nepal and Laos, profiled using Fluidigm RT-PCR, the 8-gene classifier distinguished bacterial infections from viral infections with an AUROC of 0.94 (87.9% specificity, 91% sensitivity). Interpretation: The 8-gene signature met the target product profile (90% sensitivity, 80% specificity) proposed by the WHO and others for distinguishing bacterial and viral infections. The 8-gene signature should be considered for further validation and implementation. Funding Information: PK is funded in part by the Bill and Melinda Gates Foundation (OPP1113682); the National Institute of Allergy and Infectious Diseases (NIAID) grants 1U19AI109662, U19AI057229, and 5R01AI125197; Department of Defense contracts W81XWH-18-1-0253 and W81XWH1910235; and the Ralph & Marian Falk Medical Research Trust. DAR is supported by NIH/NIAID U19 AI109761 and the Thomas C. and Joan M. Merigan Endowment at Stanford University. LOMWRU is funded by the Wellcome Trust of Great Britain. AMR is funded by the National Science Foundation Graduate Research Fellowship and the Stanford Graduate Fellowship. This research was funded in whole, or in part, by the Wellcome Trust [Grant number 220211]. Declaration of Interests: AMR, SJP, TES, DAR, and PK are named as inventors on a patent application describing the 8-gene set, which has been licensed to Inflammatix. TES and SAT are employees of Inflammatix, and TES and PK are shareholders in Inflammatix. Inflammatix had no role in the design, funding, or reporting of this work. SD is currently employed by FIND. The other authors declare no conflicts of interest. Ethics Approval Statement: Ethical clearance was granted by the former Faculty of Medical Sciences Ethical Review Committee (now University of Health Sciences Ethics Committee), National University of Laos, the Oxford University Tropical Ethics Committee, and the Stanford University Institutional Review Board.