Background: Type 2 diabetes mellitus (T2DM) is a metabolic disease with debilitating effects on multiple organs. The alveolar-capillary network in the lung is a large microvascular unit which may be affected by T2DM-associated microangiopathy. Methods: This retrospective study investigated whether type 2 diabetes mellitus (T2DM) affected pulmonary function. Of the 584 patients enrolled in the study, 292 had T2DM and 292 did not. Forced expiratory volume in one second (FEV1), forced vital capacity (FVC), maximum voluntary ventilation (MVV) and total lung capacity (TLC) are values as percent of predicted, as well as FEV1/FVC ratio which were values measured. Results: FEV1, FVC, FEV1/FVC ratio, MVV, and TLC were significantly lower in T2DM than in non-T2DM (P-values < 0.010). Multiple linear regression analysis found that for the entire study population fasting plasma glucose levels was negatively associated with FEV1, FVC, FEV1/FVC ratio and maximum voluntary ventilation (P-values < 0.030). Patients with T2DM were negatively associated with total lung capacity (P-values = 0.025). Multiple linear regression analysis found for patients with T2DM that fasting plasma glucose was negatively associated with FEV1, FVC, FEV1/FVC ratio and maximum voluntary ventilation (P-values < 0.020). In T2DM patient, height was negatively correlated with FEV1 and FVC (all P-values < 0.020), triglycerides were negatively correlated with FEV1/FVC ratio (P-values = 0.048), and creatinine was negatively correlated with total lung capacity (P-values = 0.017). Conclusions: In summary, T2DM is associated with impaired pulmonary function consistent with obstructive ventilation pattern and fasting plasma glucose is an independent risk factor of reduced pulmonary function.