Background Accompanying islet alpha- and beta-cell dysregulation in type 2 diabetes (T2D) at the microscopic scale, alterations in body composition at the macroscopic scale may affect the pathogenesis of T2D. However, the connections between body composition and islet alpha-cell and beta-cell functions in T2D have not been thoroughly explored.Methods For this cross-sectional study, we recruited a total of 729 Chinese Han patients with T2D in a consecutive manner. Dual-energy X-ray absorptiometry (DXA) was used to measure body composition, which included total bone-free mass, total fat and lean mass, trunk fat and lean mass and limb fat and lean mass. Every patient underwent an oral glucose tolerance test to simultaneously detect glucose, C-peptide and glucagon. The indices of islet alpha-cell function included fasting glucagon levels and the area under the curve of glucagon after a challenge (AUC(glucagon)), while the indices of beta-cell function included the insulin sensitivity index derived from C-peptide (ISIC-(peptide)) and the area under the curve of C-peptide after a challenge (AUCC-(peptide)).Results Among all patients, fat mass, especially trunk fat mass, was significantly correlated with ISIC-(peptide) and AUCC-(peptide) levels (r = - 0.330 and 0.317, respectively, p < 0.001), while lean mass, especially limb lean mass, was significantly correlated with fasting glucagon and AUC(glucagon) levels (r = - 0.196 and - 0.214, respectively, p < 0.001). Moreover, after adjusting for other relevant variables via multivariate linear regression analysis, increased trunk fat mass was independently associated with decreased ISIC-(peptide) (beta = - 0.247, t = - 3.628, p < 0.001, partial R-2 = 10.9%) and increased AUCC-(peptide)(beta = 0.229, t = 3.581, p < 0.001, partial R-2 = 8.2%), while decreased limb lean mass was independently associated with increased fasting glucagon (beta = - 0.226, t = - 2.127, p = 0.034, partial R-2 = 3.8%) and increased AUC(glucagon) (beta = - 0.218, t = - 2.050, p = 0.041, partial R-2 = 2.3%). Additionally, when separate analyses were performed with the same concept for both sexes, we found that increased trunk fat mass was still independently associated with decreased ISIC-peptide and increased AUCC-(peptide), while decreased limb lean mass was still independently associated with increased fasting glucagon and AUC(glucagon).Conclusions Increased trunk fat mass may partly account for decreased insulin sensitivity and increased insulin secretion, while decreased limb lean mass may be connected to increased fasting glucagon and postprandial glucagon secretion.