Abstract We calculate long-range interactions between Al-Y clusters along the stacking direction in Mg-Al-Y alloys with long-period stacking ordered (LPSO) structure by using first-principles calculation based on density functional theory (DFT). We find that the highly ordered LPSO structure, recently observed in Mg 75 Al 10 Y 15 alloy with 10H-type stacking sequence, is the most stable in thirteen polytypic structures. Relative energy differences in the thirteen polytypic structures suggest that significant long-range interactions between the separated stacking faults bring the highly ordered LPSO structure although short-range interactions are dominant for the stability of the alloy. In addition, we calculate and compare the long-range interactions for sixteen Mg-Metal (M)-Rare Earth (RE) alloys which have been experimentally observed to form the LPSO phase, and reveal that the long-range interactions in the alloys with M = Al are one digit larger than those with M = Zn. These results suggest that the long-range interactions between Al-RE clusters play an important role to form the highly ordered LPSO structure in Mg-Al-RE alloys.