In this work we report a study of the induced changes in structure and corrosion behavior of martensitic stainless steels nitrided by plasma immersion ion implantation (PI3) at different previous heat treatments. The samples were characterized by x-ray diffraction and glancing angle x-ray diffraction, scanning electron microscopy, energy dispersive x-ray spectroscopy, and potentiodynamic measurements. Depending on the proportion of retained austenite in the unimplanted material, different phase transformations are obtained at lower and intermediate temperatures of nitrogen implantation. At higher temperatures, the great mobility of the chromium yields CrN segregations like spots in random distribution, and the a' -martensite is degraded to -Fe (ferrite). The nitrided layer thickness follows a fairly linear relationship with the temperature and a parabolic law with the process time. The corrosion resistance depends strongly on chromium segregation from the martensitic matrix, as a result of the formation of CrN during the nitrogen implantation process and the formation of CrxC during the heat treatment process. Briefly speaking, the best results are obtained using low tempering temperature and low implantation temperature (below 375 degrees) due to the increment of the corrosion resistance and nitrogen dissolution in the structure with not too high diffusion depths (about 5-10 um).