Diabetes mellitus is a highly challenging global health care problem. This study aimed to assess the effect of glycated hemoglobin (HbA1c) and duration of diabetes on lung function in type 2 diabetic patients and assess whether duration or high HbA1c is more noxious to damage the lung functions. A total of 202 participants, 101 patients with type 2 diabetes mellitus (T2DM), and 101 age-, gender-, height-, and weight-matched controlled subjects were recruited. The HbA1c was measured through a clover analyzer, and lung function test parameters were recorded by spirometry. The results revealed a significant inverse correlation between HbA1c and Vital Capacity (VC) (r = −0.221, p = 0.026), Forced Vital Capacity (FVC) (r = −0.261, p = 0.008), Forced Expiratory Volume in First Second (FEV1) (r = −0.272, p = 0.006), Forced Expiratory Flow 25% (FEF-25%) (r = −0.196, p = 0.050), Forced Expiratory Flow 50% (FEF-50%) (r = −0.223, p = 0.025), and Forced Expiratory Flow 75% (FEF-75%) (r = −0.169, p = 0.016). Moreover, FEV1 (p = 0.029), FEV1/FVC% (p = 0.006), FEF-50% (p = 0.001), and FEF-75% (p = 0.003) were significantly lower in the diabetic group with duration of disease 5–10 and >10 years compared to the control group. The overall results concluded that high HbA1c or uncontrolled diabetes mellitus has a more damaging effect on lung function impairment compared to the duration of diabetes mellitus. Physicians must regularly monitor the HbA1c level while treating diabetic patients, as good glycemic control is essential to minimize the complications of DM, including lung function impairment in patients with T2DM.