The Londoners confirmed it was a record but did not disclose the fee. Media reports said the 24-year-old cost £42.5 million, eclipsing the previous highest of £15 million paid for Russian Andriy Arshavin in 2009.
"We are extremely pleased to have signed Mesut Ozil," manager Arsene Wenger said on the club website.
"He is a great player with proven quality at both club and international level. We have watched and admired him for some time as he has all the attributes I look for in an Arsenal player."
Chief executive Ivan Gazidis added: "This is an exciting day for all of us. We have signed a world-class player who is one of Europe's brightest young talents."
Arsenal's only previous signings in this window were free agents - France youth international Yaya Sanogo and returning midfielder Mathieu Flamini from AC Milan. They also took Palermo's Italy goalkeeper Emiliano Viviano on loan.
Speaking after completing his medical in Germany, Ozil said: "I am thrilled to be joining a club of the stature of Arsenal and am looking forward to playing in the Premier League.
"It will be great for my own personal development as a player and I am particularly looking forward to working with Arsene Wenger.
"From our negotiations it is clear the club have huge ambition and I look forward to being part of an exciting future."
Ozil had earlier flown from Madrid to Munich to link up with the Germany squad preparing for their World Cup qualifiers against Austria on Friday and the Faroe Islands next Tuesday.
"We're all looking forward to him joining up with us after his international matches and working with us as an Arsenal player," said Wenger.
The Frenchman was criticised by the fans and the media for not splashing out on new players especially with neighbours Tottenham spending more than £110 million on seven internationals ahead of Bale's departure to Real.
Wenger, however, indicated after Arsenal beat Spurs 1-0 in the Premier League on Sunday that a major signing could be completed on the final day of the window.
"I have said throughout the summer that we have been working hard to bring in top quality players," he said after signing long-term target Ozil.
"This has involved many, many people across the club and I have always had the full support of the club in making decisions on the football side."
Gazidis added: "Mr (Stan) Kroenke, our controlling owner, has always fully supported Arsene and the club in making significant investments to strengthen our squad and to bring in talented players who fit our style and ambitions.
"Like all of us Mr Kroenke wants to see Arsenal winning titles and trophies and he has absolute faith and belief in our manager to achieve that. We will continue to work towards that goal and look forward to an exciting season."
The Gunners have endured a frustrating eight-year wait for silverware since winning the FA Cup in 2005.
Ozil joined his hometown club Schalke in 2006, aged 18, and after two years with the Gelsenkirchen club moved to Werder Bremen in 2008.
After making 71 appearances for Werder he left for Madrid following impressive displays for Germany at the 2010 World Cup in South Africa. He has 47 caps and has scored 17 international goals.
"Sometimes things develop differently than I would have expected them to a few days ago. Although I'm leaving Real Madrid I wish you and the team the very best for the future. Now I'm looking forward to my new club: THE GUNNERS!"
Meanwhile, Palermo have confirmed that goalkeeper Emiliano Viviano has signed a season-long loan deal with Arsenal, with the Gunners having the option to make the deal permanent.
The 27-year-old Italy international will compete with Wojciech Szczesny to be the Frenchman's first-choice stopper for the remainder of the campaign.
Wenger is believed to have had a long-standing interest in Viviano as he looks to create competition in between the posts for Arsenal, with Lukasz Fabianski also available as an option.
Serie B club Palermo announced the deal with a short statement on their official website which read: "Goalkeeper Emiliano Viviano has been released to Arsenal on loan with the option to buy."
A product of the Brescia youth system, Viviano went on to play for the club for five years before signing Bologna, with Inter Milan purchasing 50 per cent of his registration before the move.
He went on to spend a season at the San Siro but a knee injury curtailed his first-team opportunities in Milan with a move to Palermo completed in 2012.
The club were relegated to Serie B last season but Viviano spent the campaign on loan at Fiorentina, who finished fourth in Serie A.