It is unclear whether Trimethylamine N-oxide (TMAO) and its precursors are bidirectionally associated with kidney dysfunction. This study aims to investigate whether increased TMAO and its precursors are linked to decreased eGFR and whether reduced eGFR is associated with elevated TMAO and its precursors. Our study consists of participants with creatinine, TMAO, and its precursors (choline, carnitine, betaine) repeatedly measured from Fuxin Rural Cohort. We utilized cross-lagged panel models (CLPM) to assess the potential bidirectional associations of TMAO and its precursors with eGFR. Age-(≥60 and <60 years) and sex-specified associations and interaction effects were examined using multi-group CLPMs. Bonferroni method was applied for multiple comparison. Of 1746 participants (mean age 59.4 ± 9.3 years, 584 (33%) male), TMAO was inversely related to eGFR after two years (Cross-Lagged Coefficient, 95% CI: -0.030, -0.058 to -0.002, P=0.035), and eGFR was negatively associated with carnitine after two years (-0.138, -0.198 to -0.078, P<0.001). Subgroup analysis showed significant associations between baseline TMAO and eGFR after two years in individuals aged 60 and older (-0.061, -0.107 to -0.014, P=0.011), and between baseline eGFR and carnitine after two years in individuals aged 60 and older (-0.093, -0.164 to -0.022, P=0.010), in those under 60 (-0.153, -0.226 to -0.079, P<0.001), and in females (-0.154, -0.229 to -0.079, P<0.001). Additionally, baseline eGFR is nominally associated with choline after two years in those aged under 60 (0.092, 0.017 to 0.167, P=0.017) and in males (0.114, 0.015 to 0.213, P=0.025). Deceased eGFR is related to elevated serum carnitine level and may be linked to choline. Conversely, elevated TMAO may be linked to reduced kidney function. This provides novel evidence that managing healthy kidney function helps keep TMAO and its precursors at optimal levels, while maintaining low TMAO levels reduces the risk of kidney disease.