Backgrounds: The role of right ventricular (RV) and atrial (RA) structure and function, in the increased heart failure risk in (pre)diabetes is incompletely understood. The purpose of this study is to investigate the associations between (pre)diabetes and RV and RA structure and function, and whether these are mediated by left ventricular (LV) alterations or pulmonary pressure. Methods: Participants of the Maastricht Study; a population-based cohort study (426 normal glucose metabolism (NGM), 142 prediabetes, 224 diabetes), underwent two-dimensional and tissue Doppler echocardiography. Multiple linear regression analyses with pairwise comparisons of (pre)diabetes versus NGM, adjusted for cardiovascular risk factors, and mediation analyses were used. Results: In general, differences were small. Nevertheless, in individuals with prediabetes and diabetes compared to NGM; RA volume index was lower (both p < 0.01, p trend < 0.01), RV diameter was lower (both p < 0.01, p trend < 0.01) and RV length was significantly smaller in diabetes (p = 0.67 and p = 0.03 respectively, p trend = 0.04), TDI S′RV was lower (p = 0.08 and p < 0.01 respectively, p trend < 0.01), TDI E′RV was lower (p = 0.01 and p = 0.02 respectively, p trend = 0.01) and TDI A′RV was lower (p < 0.01 and p = 0.07 respectively, p trend = 0.04). Only the differences in RA volume index (7.8%) and RV diameter (6.2%) were mediated by the maximum tricuspid gradient, but no other LV structure and function measurements. Conclusions: (Pre)diabetes is associated with structural RA and RV changes, and impaired RV systolic and diastolic function, independent of cardiovascular risk factors. These associations were largely not mediated by indices of LV structure, LV function or pulmonary pressure. This suggests that (pre)diabetes affects RA and RV structure and function due to direct myocardial involvement.