La Liga - Ozil signs for Real Madrid
Neither side revealed details of the costs involved, but Spanish media reported a figure of 15 million euros (£12.4m) had been agreed.
Werder, who had been fighting to hang on to the midfielder, appear to have accepted Ozil's desire to leave after a meeting at their stadium earlier in the day.
The German club said he would not be part of their side to face Italy's Sampdoria on Wednesday for the Champions League qualification play-off, which means he will be able to compete with Real in the same competition.
He is expected to take a medical in Madrid on Wednesday.
Ozil, who is of Turkish descent, joined Bremen in January 2008 from Schalke 04 and scored 12 goals in 71 Bundesliga appearances for them.
He won the Under-21 European championship in 2009 and has scored twice in 17 full international games.
At Real, he will join a host of other young signings under new coach Jose Mourinho as they attempt to wrest the La Liga title from Barcelona.
The Spanish giants have already landed midfielder Khedira from VfB Stuttgart, wingers Angel Di Maria and Pedro Leon and midfielder Sergio Canales, along with experienced defender Ricardo Carvalho.