A heat treatment technology for improving mechanical properties of rare earth magnesium alloy castings is a heat treatment method which is used for carrying out staged solution and staged aging on Mg-Y-Nd magnesium alloy castings. Solution and aging are regarded as a whole body, namely, after being heated and subjected to primary solution and secondary solution sequentially, the castings are subjected to tertiary artificial aging sequentially, solution temperature, insulating time, aging temperature and insulating time are controlled, in a process of aging precipitation of strengthening phases containing Nd, a Y element is in a solution state, in a process of aging precipitation of a compound containing Y, a compound containing Nd cannot grow, the number of the strengthening phases subjected to aging precipitation is large, the strengthening phases are tiny, growth of crystal grains in a solution process is also avoided, and the mechanical properties of the alloys are improved. The heat treatment technology is simple, existing heat treatment equipment is not required to be modified, the mechanical properties of the obtained alloys are greater than those of alloys treated by a conventional method by at least 10%, industrial production is easy to implement, and a simple and efficient effective way is provided for improving the mechanical properties of the large-size rare earth magnesium alloy castings.