Pepe joined Real Madrid from Porto in 2007. Getty

Portugal international Pepe has completed his move to Besiktas after his contract at Real Madrid came to an end. Paris Saint Germain, Inter Milan, Manchester City and Chelsea have all been linked with his services in recent months but the 34-year-old defender has finally agreed a two-year deal, with an option of a further 12 months.

Pepe has been a crucial player for the La Liga giants since arriving from Porto in the summer of 2007 for around €30m (£26.3m, $34m) helping the club to win three La Liga titles and three Champions Leagues.

The Portugal international made 18 appearances during the 2016-17 campaign but his long-term future with Zinedine Zidane's side has been under scrutiny in recent months due to a contract dispute.

In October, The Mirror reported that Chelsea were closely monitoring the situation with Los Blancos being reluctant to offer him a two-year-deal due to his age. City were also linked with him before reports suggested that he was ready to move to China.

Last month Pepe already confirmed his decision to leave the Real after being upset with club officials.

"Madrid didn't offer me two years. They just offered me one year, so it's clear that I'm not going to continue with Real Madrid. There are ways of talking and negotiating but the club hasn't acted correctly. That's annoyed me," Pepe said.

"So I am not going to continue with the club. An era has come to an end and a new one will begin. In fact, I've already started the move. Most of my things are in Portugal and I just have my house in Madrid. I have not said goodbye to [Zidane] because Zidane and Real Madrid knew that I was leaving before I did."

PSG and Inter appeared to be his most likely destinations but the Portuguese defender has finally agreed a moved to the Turkish champions.

Pepe becomes the fifth player to leave the 12-time European champions during the summer transfer window. Mariano, Diego Llorente and Enzo Zidane have been sold to Lyon, Real Sociedad and Alaves while the club have also loaned Federico Santiago Valverde to Deportivo La Coruña.

Real are yet to sign any players this summer but Spanish Under 21 international Jesus Vallejo is expected to cover for Pepe during the upcoming season following a promising loan spell at Eintracht Frankfurt.