Single crystals of CdZnTe of dimensions 10 times 10 times 3 mm3 and HgI2 of dimensions 10 times 10 times 2 mm3 were fabricated into planar detectors. Four sets of detectors were then exposed to simulated solar proton events of varying magnitude at the Kernfysisch Versneller Instituut in the Netherlands. Events were simulated by generating protons over the energy range 60 MeV to 200 MeV in 10 energy bands which approximated the spectral shape of the August 1972 solar particle event. One pair of detectors (a CdZnTe and a HgI2) was exposed to an integral fluence of 108 protons cm-2, a second to 109 protons cm-2, a third to 1010 protons cm-2 and the fourth to 1011 protons cm-2. The latter corresponds to an absorbed dose in silicon of 100 krad or in SI units, 1 kGy. The detectors were characterized both before and after the irradiations in terms of background count rate and spectral performance using 55Fe, 109Cd, 241Am, 57Co and 137Cs radioactive sources. Typical pre-irradiation FWHM energy resolutions of 3 keV and 4 keV were recorded at 60 keV for the CdZnTe and HgI2 detectors, respectively. It was found that HgI2 is very radiation tolerant showing little degradation in energy resolution or charge collection efficiency (CCE) for input fluences up to 1011 protons cm-2. CdZnTe, on the other hand, showed a clear degradation in energy resolution and CCE for input fluences above 109 protons cm-2. For example, the energy resolution degraded by a factor of 3 between 109 and 1010 protons cm-2 while the CCE decreased by a factor of 2.