Hazard joined for £89m in 2019 but has played just 54 league games, including only six this season.
The 32-year-old was under contract until June 2024 but on Real have "reached an agreement" to end the deal.
The club said it expressed its "affection" to former Chelsea forward Hazard and wished him "the best of luck for the next stage of his career".
During his injury-hit time in the Spanish capital, the Belgium international won the Champions League, a Club World Cup, a European Super Cup, two La Liga titles, one Copa del Rey and two Spanish Super Cups.
In 76 matches in all competitions, he scored seven goals, a stark drop off from his mark of 110 in 352 matches for Chelsea.
Ancelotti has 'no doubts' over Benzema future
Benzema has scored 18 goals in 23 La Liga games this season
Carlo Ancelotti's side will finish second in La Liga if they beat Athletic Bilbao in their final league game on Sunday.
Changes could be afoot at the club this summer given their 11-point deficit to champions Barcelona.
Reports this week linked Karim Benzema with a lucrative move to Saudi Arabia but Ancelotti says he has "no doubts" the striker will stay.
Benzema, 35, has won 25 trophies in 12 seasons with the club and claimed "the internet is not reality" when asked about his future on Thursday.
And on Saturday Ancelotti said: "Benzema is ready to play tomorrow, he's recovered nicely and he has a year left on his contract, so we have no doubts here.
"The internet is not reality. I agree with Benzema. The club's legends should finish their careers at Real Madrid. This is what the fans and the club want. The club, the fans and I think so."
However one player who will not feature for the Spanish giants next season is Marco Asensio, who is set to depart after eight years at the club.
Forward Asensio, 27, shared a farewell video on his Twitter page and will leave when his contract expires this summer.
He has won three league titles and the Champions League three times in his time at the club, scoring 61 goals in 285 appearances.