"Real Madrid and Luka Modric have agreed the extension of the contract of the player, who will remain at the club until June 30, 2022," the club said in a brief statement.
Last month, Madrid president Florentino Perez confirmed that the Croatia international would be staying at the club.
"We reached a renewal agreement already, some time ago," Perez told El Larguero.
Modric made 35 league appearances for Real Madrid this season -- the most in his nine years at the club -- as they finished second in La Liga to champions Atletico Madrid.
"I've always said I want to carry on at Real Madrid," Modric said last month ahead of Madrid's Champions League quarterfinal second leg with Liverpool. "I feel really happy here, and I hope I'll carry on next year."
Modric joined Madrid from Tottenham in 2012 for €30 million and faced early criticism, being voted the "worst signing of the year" in a poll by newspaper Marca.
He went on to become a key member of the team that won four Champions League trophies -- three of them back-to-back from 2016 to 2018 -- as well as two La Liga titles in 2017 and 2020.
Ramos and Vazquez are yet to reach agreements on extensions, with Madrid's limited finances in the wake of the coronavirus pandemic hindering talks.
There are also doubts over the future of coach Zinedine Zidane, whose deal expires in 2022.
Zidane has said he will hold talks "in the next few days" with club bosses over his plans for next season.