We have studied the change in the magnetic properties produced on highly oriented pyrolytic graphite samples by irradiation of H, C, and N ions in the mega-electron-volt energy range. The use of specially made sample holders for the magnetic measurements provided high reproducibility allowing us to obtain directly the irradiation effects without any corrections or subtractions. Our results show that three magnetic phenomena are triggered by the defects produced by the irradiation, namely, Curie-type paramagnetism, ferromagnetism and an anomalous paramagnetic state that appears as precursor of the magnetic ordered state. Using SRIM simulations to estimate the amount of vacancies produced by the irradiation, the Curie-type paramagnetic response indicates an effective Bohr magneton number per nominally produced vacancy p=0.27 perpendicular to 0.02 mu(B). Direct measurements of the surface sample temperature during irradiation and the decrease in the (as-received) paramagnetic as well as ferromagnetic contributions after irradiation indicate that self-heating is one of the causes for small yield of ferromagnetism. Taking into account the hydrogen distribution in the virgin samples, the obtained results indicate that the induced ferromagnetism appears when the average vacancy distance is similar to 2 nm in the near surface region.