The club did not reveal the details of his contract but Greek media reported that the former Brazil international signed a one-year deal with an option for another year. He has also been registered to play in the Europa League campaign.
Marcelo, who made 546 appearances for Real Madrid since joining in 2007, left at the end of last season as the most decorated player in the club's 120-year history with 25 trophies -- including five Champions League titles.
"We've spoken and we've decided it's best like that," Marcelo said in confirming his exit after being an unused substitute in May's Champions League final victory over Liverpool. "I've already done everything I had to do at Madrid. I've been lucky to be here for 15 and a half years at the best club in the world."
The 34-year-old had dismissed retirement and wanted to continue playing in Europe instead of returning to Brazil.