Nonalcoholic fatty liver disease (NAFLD) has been associated with relative skeletal muscle mass in several cross-sectional studies. We explored the effects of relative skeletal muscle mass and changes in relative muscle mass over time on the development of incident NAFLD or the resolution of baseline NAFLD in a large, longitudinal, population-based 7-year cohort study. We included 12,624 subjects without baseline NAFLD and 2943 subjects with baseline NAFLD who underwent health check-up examinations. A total of 10,534 subjects without baseline NAFLD and 2631 subjects with baseline NAFLD were included in analysis of changes in relative skeletal muscle mass over a year. Subjects were defined as having NAFLD by the hepatic steatosis index, a previously validated NAFLD prediction model. Relative skeletal muscle mass was presented using the skeletal muscle mass index (SMI), a measure of body weight-adjusted appendicular skeletal muscle mass, which was estimated by bioelectrical impedance analysis. Of the 12,624 subjects without baseline NAFLD, 1864 (14.8%) developed NAFLD during the 7-year follow-up period. Using Cox proportional hazard analysis, compared with the lowest sex-specific SMI tertile at baseline, the highest tertile was inversely associated with incident NAFLD (adjusted hazard ratio [AHR] = 0.44, 95% confidence interval [CI] = 0.38-0.51) and positively associated with the resolution of baseline NAFLD (AHR = 2.09, 95% CI = 1.02-4.28). Furthermore, compared with the lowest tertile of change in SMI over a year, the highest tertile exhibited a significant beneficial association with incident NAFLD (AHR = 0.69, 95% CI = 0.59-0.82) and resolution of baseline NAFLD (AHR = 4.17, 95% CI = 1.90-6.17) even after adjustment for baseline SMI. Conclusion: Increases in relative skeletal muscle mass over time may lead to benefits either in the development of NAFLD or the resolution of existing NAFLD.