The new arrival will raise further doubts about the long-term future of Madrid vice-captain Marcelo, 31, while youngster Sergio Reguilon, 22, could go on loan for 2019-20. Theo Hernandez, 21, is not expected to feature in Zinedine Zidane's plans.
Mendy scored three goals and contributed three assists in 44 games for Lyon last season, impressing with his raids forward into attack against Manchester City and Barcelona in his team's run to the Champions League round of 16.
The France international created 40 chances in 30 Ligue 1 games for Lyon last season, while all Real Madrid left-backs combined to create just 50 chances in 38 games.
Madrid have already signed Serbia striker Luka Jovic, 21, from Eintracht Frankfurt for €60m, Brazil defender Eder Militao, 21, from Porto for €50 million and Brazilian forward Rodrygo, 18, from Santos for €54m.
ESPN FC writer Dermot Corrigan contributed to this story.