Magnesium alloys are very interesting engineering materials because of their high strength-to-density ratio. On the other hand, they are characterized by low hardness as well as low erosion resistance. Because of these reasons, their applications in the industry are very limited. The article presents the results of the high velocity oxy-fuel (HVOF) spraying of the hard cermet coatings onto AZ31 magnesium alloy substrate. Three feedstock powders were used in the process with composition (wt.%): WC-12Co, WC-10Co-4Cr and WC-20Cr 3 C 2 Ni. The spray distance (SD) was selected as a variable parameter with values equal to 320 and 400 mm. Observations carried out under a scanning electron microscope (SEM) revealed a typical HVOF-sprayed microstructure with a compact structure and low porosity (below 3 vol.%). The hardness of the manufactured coatings, ranging from 912 HV0.2 to 1328 HV0.2, what was significantly higher than the substrate. The solid particle erosion tests were carried out according to the ASTM G76-04 standard. Erosive experiments were done for 30°, 60° and 90° inclination angles of the nozzle using Al 2 O 3 abrasive. Erosion tests confirm that cermets exhibit substantial erosion resistance better than the substrate. The highest erosion resistance was noted for WC-10Co-4Cr coatings. The erosion rate for cermet coatings was mostly below 0.9 mg/min, whereas for the AZ31 it was more than 1.5 mg/min. In the case of the average erosion value, it was between 12 and 22 times lower than for the substrate. Results analysis reveal that shorter spray distance decreases porosity, increases hardness, and finally supports erosion resistance of the cermets.