Rafa Benitez told Pepe he wasn’t needed at the club, according to the defender.
The 33-year-old has featured regularly for Zinedine Zidane since the Frenchman replaced Benitez in January but it could have been a different story had the former Liverpool and Inter Milan boss stayed.
Pepe, who had played for Los Blancos was nine years, has been linked with a move away from the club in the past but has always been determined to stay at the Santiago Bernabeu.
But when Benitez took over last summer he was told he would only be third choice behind Sergio Ramos and Raphael Varane and was not really needed.
Speaking to Cadena Cope, the centre back said he has worked harder than ever over recent months to prove himself.
“It is a matter of hard work. At the beginning of the year Benitez told me he did not need me, that I was third choice. But I worked hard and today I have been here nine years and people know what you can expect from me,” he said.
And he added: “It’s normal, you have Sergio and Raphael, who are younger than me. But if you work and you give something in every workout, you will have the opportunity.”