"We respect that Mesut wants to go and take the next step in his career," said Werder Bremen's director of sport Klaus Allofs in a statement.
Özil was one of the stars at last month's World Cup and the attacking midfielder played a key role in helping Germany finish third.
With Werder Bremen preparing for a Champions League qualifying match against Sampdoria on Wednesday, the 21-year-old Özil sat out training on Tuesday and is expected in Madrid on Wednesday to undergo a medical.
Özil joined Bremen in January 2008 from Schalke 04 and won the German Cup with Werder in 2009. He has played 71 games for Werder and scored 12 goals.
Having won the European Under-21 Championships with Germany in June 2009, he was nominated as one of the ten best players at the World Cup in South Africa.
"Mesut Özil lands at Real Madrid after a standout performance at the 2010 World Cup in South Africa," Real meanwhile announced on their wesbite.
"The midfielder earned a permanent spot on Germany's senior side by the age of 21 after winning the 2009 Under-21 European Championship.
"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."
Özil, a gifted and versatile midfielder with a great left foot, was spotted by Schalke whose academy he joined in 2005.
Within a year he had graduated to the first team and he made his Bundesliga debut at just 17.