Abstract Background and Aims Observational studies have demonstrated a significant association between long-term weight loss and weight gain and an increased risk of mortality among chronic hemodialysis patients. However, underlying mechanisms of these associations remain insufficiently explored. To address this knowledge gap, we conducted an in-depth analysis using a cohort of hemodialysis patients, benefiting from comprehensive baseline data, regular six-month evaluations, and an extended follow-up period. We employed advanced statistical techniques, including Lasso regression, to construct predictive models for long-term weight loss and gain. Furthermore, we conducted mediation analyses to elucidate whether weight change mediates the impact of major risk factors on all-cause mortality. Method This post-hoc analysis utilized data from participants in a previous randomized controlled trial conducted between 2006 and 2011, named as the Olmesartan clinical trial in Okinawan patients under the OKIDS (OCTOPUS) study. Subsequently, we tracked participants' mortality outcomes until July 2018. At the time of enrollment, we collected comprehensive baseline information, encompassing demographics, medical history, and laboratory data. Throughout the trial, participants' body weights were meticulously recorded every six months. Our analysis was restricted to patients who survived for at least two years post-enrollment, ensuring a minimum of five body weight measurements during the trial. Lasso regression was employed in training datasets (comprising 60% of participants) to identify crucial risk factors associated with long-term weight gain (>1 kg per year) or weight loss (<−1 kg per year) among chronic hemodialysis patients. These selected models were subsequently applied to paired validation datasets (comprising 40% of participants), and receiver operating characteristic (ROC) curves were used to calculate the area under the curve (AUC), aiding in the identification of key risk factors for long-term weight changes. Subsequently, we conducted mediation analyses to investigate whether weight change mediated the relationship between risk factors and all-cause mortality. Results Our analysis included 404 out of 461 OCTOPUS participants, with 60.9% being male, a mean age of 59.2 years (±11.7), and a mortality rate of 41.6%. The median follow-up period extended to 10.3 years. In the training datasets, Lasso models identified critical predictors for weight increase, including a history of diabetes, younger age, normal cardio-thoracic ratio (CTR) (<50% for males and <53% for females), and BMI <20. Conversely, predictors for weight decrease included BMI ≥20, serum sodium <135 mEq/L, serum albumin <3.5 g/dL, and older age. Weight increase demonstrated higher predictability (mean AUC of 0.59) compared to weight decrease (mean AUC of 0.55) in the validation datasets. Mediation analyses revealed that weight loss mediated 30% of the impact of older age (≥70 years old) on all-cause mortality (P = 0.068). Conclusion Our findings suggest that, among chronic hemodialysis patients, long-term weight increase is associated with a history of diabetes and younger age, while long-term weight loss is linked to BMI (≥20), hyponatremia, hypoalbuminemia, and older age. Notably, long-term weight loss appears to explain 30% of the increased risk of all-cause mortality associated with older age (≥70 years old).