The 21-year-old playmaker was linked with a move away from the Bundesliga after some eye-catching performances for Germany at the World Cup.
Ozil will undergo a medical at the BernabÃƒÂ©u on Wednesday before joining up with JosÃƒÂ© Mourinho’s side ahead of the new Spanish season.
A statement posted on Real Madrid’s website read: “His unique touch, unmatched individual technique, excellent ball control and deadly last pass make the German midfielder one of the brightest up-and-coming stars in European football.”
“We respect that Mesut wants to go and take the next step in his career,” added Werder Bremen’s director of sport Klaus Allofs.
Ozil scored 11 goals in 46 appearances for Werder Bremen last season and made the shortlist for player of the tournament after sparkling for Germany in South Africa.
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news