Higher cardiorespiratory fitness is associated with lower risk of type 2 diabetes. However, the causality of this relationship and the biological mechanisms that underlie it are unclear. Here, we examine genetic determinants of cardiorespiratory fitness in 450k European-ancestry individuals in UK Biobank, by leveraging the genetic overlap between fitness measured by an exercise test and resting heart rate. We identified 160 fitness-associated loci which we validated in an independent cohort, the Fenland study. Gene-based analyses prioritised candidate genes, such asCACNA1C, SCN10A, MYH11andMYH6, that are enriched in biological processes related to cardiac muscle development and muscle contractility. In a Mendelian Randomisation framework, we demonstrate that higher genetically predicted fitness is causally associated with lower risk of type 2 diabetes independent of adiposity. Integration with proteomic data identified N-terminal pro B-type natriuretic peptide, hepatocyte growth factor-like protein and sex hormone-binding globulin as potential mediators of this relationship. Collectively, our findings provide insights into the biological mechanisms underpinning cardiorespiratory fitness and highlight the importance of improving fitness for diabetes prevention.