Background Direct whole-genome sequencing of Mycobacterium tuberculosis from clinical specimens will be a major breakthrough in tuberculosis diagnosis and control. To date, direct whole-genome sequencing has never been used in genomic epidemiology, and its accuracy in transmission inference remains unknown. We investigated the technical challenges imposed by direct whole-genome sequencing, and used it to infer transmission clusters and predict drug resistance.Methods Using an optimised workflow, we did direct whole-genome sequencing for 37 clinical specimens from 23 tuberculosis patients. Nine sputum samples from nine patients who were infected with different non-tuberculous mycobacteria and culture-negative for tuberculosis were used as controls in the qPCR assays and pre-sequencing runs. Additionally, 780 clinical isolates in the region of Comunidad Valenciana (Spain) were whole-genome sequenced between Jan 1, 2014, and Dec 31, 2016. We analysed the genomic variants to build a tuberculosis transmission network for the region, including the clinical specimens, and to predict drug susceptibility profiles.Findings After sequencing 37 clinical specimens, 28 specimens (22 [85%] of 26 smear-positive and six [55%] of 11 smear-negative) met the quality criteria for downstream analysis. All 28 clinical specimens clustered with their matching culture isolates, with a median distance of 0 single nucleotide polymorphisms. Of the 28 clinical specimens, 16 (57%) were accurately assigned to ten transmission clusters in the region, and 12 (43%) were unique cases. Transmission inferences and drug-susceptibility predictions from direct whole-genome sequencing data were concordant with sequences from corresponding cultures and phenotypic drug-susceptibility testing. Complete genomic analysis, within a week of specimen receipt, cost €217 per sample (excluding personnel costs).Interpretation Direct whole-genome sequencing could be used to accurately delineate transmission clusters of tuberculosis and conduct culture-independent surveillance. Compared with conventional approaches, direct wholegenome sequencing allows researchers to do real-time genomic epidemiology and drug resistance surveillance in settings where culture and drug susceptibility testing are not available.