The Belgian, who was acquired by Chelsea in an expensive agreement potentially worth up to £150m, has been beset by injuries during his tenure in Spain and has plummeted to the bottom of the hierarchy.
Hazard shined in the Premier League and sealed a dream move to Madrid, but injuries have affected most of his spell there.
A club statement said: “Real Madrid CF and Eden Hazard have reached an agreement whereby the player will be released from the club as of June 30, 2023.
“Eden Hazard has been part of our club for four seasons, in which he has won 8 titles: 1 European Cup, 1 Club World Cup, 1 European Super Cup, 2 Leagues, 1 Copa del Rey and 2 Spanish Super Cups.
Following 110 goals and 92 assists in 352 games for Chelsea, the winger signed for Madrid in a deal rising to £142million.
He played just 22 matches in his first season that was affected by various injuries and knocks, scoring one goal and assisting seven.
Hazard experienced ongoing problems, particularly with his muscles and fibula, which detrimentally affected his goal-scoring output in later seasons.
He has had only ten showings this season and may be bidding farewell to Madrid end of June.