The Portugal international, who appeared over 300 times for Los Blancos, joined the Turkish side after his contract in the Spanish capital expired.
Pepe, who is reportedly set to earn around £2.9 million a year in the Super Lig, joins countryman Ricardo Quaresma at the Istanbul side.
Upon his unveiling, Pepe revealed his admiration for the club he has spent the past decade at and thanked fans for their support.
"I spent 10 wonderful years at Real Madrid," Pepe said to the press following confirmation of the transfer. "My two daughters were born in Madrid, I won three Champions Leagues and three La Liga titles as well.
"I love Real Madrid and their fans."
The defender has sparked controversy on numerous occasions, including a tie against lowly Getafe in 2009, and has carried the tag of a no-nonsense centre-back ever since.
"Something happened in a game against Getafe and I was punished for it," he added. "Since then, I have been judged and labelled as an aggressive player.
"I have always done everything to defend my goal."