Culture of multiple periprosthetic tissue samples is the current gold-standard for microbiological diagnosis of prosthetic joint infections (PJI). Additional diagnostic information may be obtained through sonication fluid culture of explants. However, current techniques can have relatively low sensitivity, with prior antimicrobial therapy and infection by fastidious organisms influencing results. We assessed if metagenomic sequencing of complete bacterial DNA extracts obtained direct from sonication fluid can provide an alternative rapid and sensitive tool for diagnosis of PJI. We compared metagenomic sequencing with standard aerobic and anaerobic culture in 97 sonication fluid samples from prosthetic joint and other orthopaedic device infections. Reads from Illumina MiSeq sequencing were taxonomically classified using Kraken. Using 50 samples (derivation set), we determined optimal thresholds for the number and proportion of bacterial reads required to identify an infection and validated our findings in 47 independent samples. Compared to sonication fluid culture, the species-level sensitivity of metagenomic sequencing was 61/69(88%,95%CI 77-94%) (derivation samples 35/38[92%,79-98%]; validation 26/31[84%,66-95%]), and genus-level sensitivity was 64/69(93%,84-98%). Species-level specificity, adjusting for plausible fastidious causes of infection, species found in concurrently obtained tissue samples, and prior antibiotics, was 85/97(88%,79-93%) (derivation 43/50[86%,73-94%], validation 42/47[89%,77-96%]). High levels of human DNA contamination were seen despite use of laboratory methods to remove it. Rigorous laboratory good practice was required to prevent bacterial DNA contamination. We demonstrate metagenomic sequencing can provide accurate diagnostic information in PJI. Our findings combined with increasing availability of portable, random-access sequencing technology offers the potential to translate metagenomic sequencing into a rapid diagnostic tool in PJI.