The 34-year-old, who is the most decorated player in Real history with 25 trophies, will leave when his contract expires at the end of June.
He said he is not retiring but did not know where his next club will be.
“Today is the happiest day since I’ve been in Madrid because as I leave I realise I’ve left a legacy,” he said.
Marcelo, who won five Champions Leagues and six La Liga titles during his time at the Bernabeu, was honoured at a special ceremony in recognition of his career.
He was also presented with Real’s gold membership badge by president Florentino Perez.
Marcelo has been linked with Turkish side Fenerbahce and French club Marseille.
Asked if he felt his service should have entitled him to another year with Real, he said: “I did not want to stay for another year or two out of pity.
“I’m always going to support Real Madrid and together we’ve decided to leave it well, and through the front door.
“I don’t feel like a legend. Life doesn’t end here. I’m going to continue playing. I believe I can continue but I’m not thinking much about the future.
“The most difficult thing is to say goodbye. To put on this shirt has been the most beautiful.”
Marcelo made 545 appearances for Real in all competitions after joining from Brazilian side Fluminense in 2007.
Perez said: “We wanted to pay a passionate tribute to our great captain. We speak of a legend, the player with the most titles in the history of Real Madrid.
“Dear Marcelo, you have accomplished all the dreams. You have won absolutely everything.
“You are without doubt one of the best full-backs in the history of world football, a unique player.”