Adherence to healthy dietary patterns, including fruits, vegetables and whole grains, is linked to improved health outcomes. However, limited research has explored this association in Latin American populations. This study aimed to investigate the association between adherence to a healthy eating score (unweighted and weighted) and all-cause mortality risk in a Chilean population. This longitudinal study included 5336 Chilean participants from the Chilean National Health Survey 2016 and 2017. Six healthy eating habits were considered to produce the healthy eating score (range: 0–12): consumption of seafood, whole grains, dairy products, fruits, vegetables and legumes. A weighted score was also developed. Participants were categorised into quartiles based on their final scores, with the healthiest quartile used as the reference group. Associations between healthy eating score and all-cause mortality were performed using Cox proportional hazard models adjusted for confounders. After a median follow-up of 5·1 years, 276 (5·2 %) participants died. In the fully adjusted model, compared with participants in the healthiest quartile of the score (Q4), those in the unhealthiest quartile (Q1) had 1·61 (95 % CI: 1·14, 2·27) times higher all-cause mortality risk. A similar association was observed for the weighted healthy eating score (1·52 (95 % CI: 1·03, 2·23)). An inverse trend was observed for both scores (P < 0·05). Sensitivity analyses excluding participants who died within the first 2 years showed consistent results 1·63 (95 % CI: 1·09, 2·42). Individuals with the lowest healthy eating score (unweighted or weighted) had a higher mortality risk compared with their counterparts. A healthy eating score is associated with mortality risk in the Chilean population.