The Croatian star player joined Real Madrid in 2012 and has won 28 titles during his time in the club – which is the most in the "Marängernas" history.
"Luka Modric will forever be in the hearts of all Real Madrid supporters as a unique and exemplary football player, who has always represented Real Madrid's values", says the club's president Florentino Pérez in a statement.
Of Modric's 28 titles with Real Madrid, six of them are Champions League titles. He has also won four league titles and was voted the world's best football player on the men's side in 2018, Ballon d'Or.
"Real Madrid will always be my home", writes Modric on Instagram.
"During these years, I have experienced incredible moments, comebacks that seemed impossible, finals, celebrations and magical evenings at Bernabéu. We won everything and I am very, very happy", he continues.
Recently, the Croat became a part-owner and investor in the Welsh football club Swansea.
On Saturday, Modrić will be honored at home in connection with the club's last league match of the season. Then, the club's World Championship awaits in June, where he will make his final appearances in the white jersey.