In this paper, the effect of pitting corrosion on fatigue life and fretting fatigue of elastic stable intramedullary nails (ESINs) is investigated. To this end, using a crystal plasticity formulation, the behaviour of magnesium under large deformations is investigated by implementing a user defined material subroutine (UMAT) in the Abaqus/Standard finite element solver. Using data provided by SEM images, the approximate configurations of grains in the polycrystalline material are obtained. Adopting Mg-RE (73-2) as one of candidates for implant applications, the fatigue analysis is performed, and the results are compared to the experimental fatigue data for various strain amplitudes. Furthermore, the effect of pitting corrosion on the fatigue life of the material is investigated. It is shown that the maximum accumulated plastic slip occurs at the tip of a corrosion pit. This suggests a faster crack initiation rate on corroded magnesium specimens compared to non-corroded ones, under cyclic loading. Application of pitting corrosion before cyclic loading, causes a significant reduction in the predicted cycles to crack initiation, compared to the uncorroded case. However, the number of cycles to crack initiation is almost the same irrespective of the amount of mass loss due to corrosion. Next, by modelling the fretting fatigue of ESINs, it is demonstrated that plastic slip accumulates at both the contact surface and deeper into the grain microstructure. However, the maximum values of stress and accumulated plastic slip occur at the contact surface. While the grain geometry and orientation influence the location and magnitude of accumulated plastic slip. By modelling the fretting fatigue of the material with different amounts of corrosion, it is shown that the maximum accumulated plastic slip occurs at the contact surface for the case without corrosion, and also for different percentages of corrosion. Finally, the results of fretting fatigue simulation of ESINs show that corrosion significantly accelerates crack initiation due to fretting wear.