INTRODUCTION: Observational studies suggest that physical activity lowers and sedentary behavior increases the risk of type 2 diabetes. Despite of some supportive trial data for physical activity, it is largely unresolved whether these relations are causal or due to bias. OBJECTIVE: We investigated the associations between accelerometer-based physical activity and sedentary behavior with type 2 diabetes and several glycemic traits using two-sample Mendelian randomization analysis. RESEARCH DESIGN AND METHODS: Single nucleotide polymorphisms (SNPs) associated at p<5×10-8 with accelerometer-based physical activity average accelerations, vigorous physical activity (fraction of accelerations >425 milligravities), and sedentary behavior (metabolic equivalent task ≤1.5) in a genome-wide analysis of the UK Biobank served as instrumental variables. OUTCOMES: Type 2 diabetes, hemoglobin A1c (HbA1c), fasting glucose, homeostasis model assessment of beta-cell function (HOMA-B), and homeostasis model assessment of insulin resistance (HOMA-IR). RESULTS: Physical activity and sedentary behavior were unrelated to type 2 diabetes, HbA1c, fasting glucose, HOMA-B, and HOMA-IR. The inverse variance weighted ORs per SD increment for the association between average accelerations and vigorous physical activity with type 2 diabetes were 1.00 (95% CI 0.94 to 1.07, p=0.948) and 0.83 (95% CI 0.56 to 1.23, p=0.357), respectively. These results were confirmed by sensitivity analyses using alternative MR-methods to test the robustness of our findings. CONCLUSIONS: Based on these results, genetically predicted objectively measured average or vigorous physical activity and sedentary behavior is not associated with type 2 diabetes risk or with glycemic traits in the general population. Further research is required to deepen the understanding of the biological pathways of physical activity.