The former Belgium international joined Real in 2019 and became the Spanish club's most expensive signing in history, but he has been restricted by several injury problems and struggled to settle at the Santiago Bernabeu.
Hazard, who made only six league appearances this season and 10 in all competitions, won eight trophies with Real, including the Champions League and two league titles.
"Real Madrid C. F. and Eden Hazard have reached an agreement whereby the player is disassociated from the club as of June 30, 2023," the club said.
"Real Madrid wants to express its affection for Eden Hazard and wishes him and his whole family good luck in this new stage."
During his time with Real, Hazard won a number of trophies, including the Champions League and two LaLiga titles.
He was limited to 392 minutes in the 2022-23 season and has not completed a 90 minutes for the side since December 2021, a lack of game time that affected his form for club and country.
He had a very poor World Cup in Qatar with Belgium as they exited in the pool stage and made the decision to retire from international football after the tournament.
Hazard joined Real from Chelsea for a club record fee that was reported as an initial amount of 88.5-million pounds ($110 million) before add-ons, and a weekly salary of 400,000 pounds, making him one of the team's top earners.
Having the midfielder off the wage bill for next season will potentially allow Real to target a new forward, with coach Carlo Ancelotti admitting he expects a number of fresh faces to arrive.
"The squad for next season, in general, will be different, because there are many contracts ending," Ancelotti told reporters on Saturday.
"Obviously there are contracts that end and there will be different players. But it (the squad) will be very competitive."