An automatic rail welding method wherein the welding at the bottom of a rail is conducted by uranami-welding first layer by a CO2 gas shield arc welding method; the welding at the second and subsequent layers is conducted continuously in layers by the CO2 gas shield arc welding method without interruption; the welding at an ankle portion (R2) of the rail is conducted by adding flux quickly and swichting over the welding method rapidly to electroslag welding; and the welding of up to the top surface (R5) is conducted similarly by electroslag welding. By this automatic welding method, welding of the rails at the site can be highly efficiently carried out without necessitating complicated power source switching operations and with no use of a plurality of types of welding materials.