It is inconclusive whether trimethylamine N-oxide (TMAO) and choline and related metabolites, namely trimethylamine (TMA), L-carnitine, betaine and dimethylglycine (DMG), are associated with non-alcoholic fatty liver disease (NAFLD). Our objective was to investigate these potential associations. Additionally, we sought to determine the mediating role of TMAO. In this 1:1 age- and sex-matched case-control study, a total of 150 pairs comprising NAFLD cases and healthy controls were identified. According to the fully adjusted model, after the highest tertile was compared with the lowest tertile, the plasma TMAO concentration (OR = 2<middle dot>02 (95 % CI 1<middle dot>04, 3<middle dot>92); P trend = 0<middle dot>003), L-carnitine concentration (OR = 1<middle dot>79 (1<middle dot>01, 3<middle dot>17); P trend = 0<middle dot>020) and DMG concentration (OR = 1<middle dot>81 (1<middle dot>00, 3<middle dot>28); P trend = 0<middle dot>014) were significantly positively associated with NAFLD incidence. However, a significantly negative association was found for plasma betaine (OR = 0. 50 (0<middle dot>28, 0<middle dot>88); P trend = 0<middle dot>001). The restricted cubic splines model consistently indicated positive dose-response relationships between exposure to TMAO, L-carnitine, and DMG and NAFLD risk, with a negative association being observed for betaine. The corresponding AUC increased significantly from 0<middle dot>685 (0<middle dot>626, 0<middle dot>745) in the traditional risk factor model to 0<middle dot>769 (0<middle dot>716, 0<middle dot>822) when TMAO and its precursors were included (L-carnitine, betaine and choline) (P = 0<middle dot>032). Mediation analyses revealed that 14<middle dot>7 and 18<middle dot>6 % of the excess NAFLD risk associated with L-carnitine and DMG, respectively, was mediated by TMAO (the P values for the mediating effects were 0<middle dot>021 and 0<middle dot>036, respectively). These results suggest that a higher concentration of TMAO is associated with increased NAFLD risk among Chinese adults and provide evidence of the possible mediating role of TMAO.