The 28-year-old will be officially unveiled on June 13 once he has undergone his medical.
Madrid are understood to have struck a deal with Chelsea that could rise to a club-record transfer of £130 million once all bonus payments come into play.
“Real Madrid CF and Chelsea FC have agreed to the transfer of the player Eden Hazard,” read a Madrid statement.
“The player remains linked to the club during the next five seasons, until June 30, 2024.
“Eden Hazard will be presented as a new player of Real Madrid on Thursday June 13 at the Santiago Bernabeu stadium, after passing the relevant medical examination.”
Hazard becomes Madrid’s second major signing after Frankfurt’s Luka Jovic, in a summer of rebuilding in Zinedine Zidane’s second stint as manager at the Bernabeu.
Chelsea will view the outcome of lengthy negotiations with Madrid as a success, as Real had been reluctant to pay more than £88 million.
The basic fee for Hazard is expected to reach £100 million, the sum for which Chelsea had been holding out despite the 28-year-old entering the final year of his Stamford Bridge contract.
Hazard joined Chelsea from Lille in 2012, and went on to win two Premier League titles, one FA Cup and one League Cup – and two Europa League crowns.
Chelsea moved to pay tribute to Hazard on confirming his departure, with his Blues career ending on 352 appearances and 110 goals.
“Although it is with sadness we say goodbye to Eden – and we made it absolutely clear to him the club wished him to stay – we respect the decision he has made to take on a new challenge in a different country and follow his childhood dream of playing for Real Madrid,” said club director Marina Granovskaia.
“The memories he leaves us with will not fade.
“He provided all who watched Chelsea play with great entertainment and many match-winning contributions, and for that we thank Eden enormously.
“He has been a model professional throughout his time at the club, a wonderful individual to have around and a joy to work with.
“We look forward to welcoming him back to Stamford Bridge in the future.”