The north London side were keen to offload the centre-back, with a source telling ESPN earlier on Monday that the two clubs were negotiating a fee of around €2-3 million.
"We thank Musti for his contribution at Arsenal which has spanned four-and-a-half years, more than 150 appearances and a prominent role in two FA Cup wins. Everyone associated with the club wishes Musti and his family the very best wishes for the next chapter in his career," Arsenal technical director Edu said in a team statement.
Mustafi had started just six times in all competitions this season and is yet to play a single minute in the Premier League for the Gunners.
The 28-year-old Germany international is in the final six months of his deal and was keen to return to his homeland to resurrect his career. He initially joined Arsenal from Valencia for £35m in 2016.
Meanwhile, Arsenal boss Mikel Arteta has said he is hoping for no "bad surprises" as his side work on completing several late deals before Monday's deadline.
Arsenal are in the market for a backup left-back with Crystal Palace's Patrick van Aanholt and Southampton's Ryan Bertrand under consideration as both players are out of contract at their respective clubs this summer.
A move was made further possible when Arsenal sent Ainsley Maitland-Niles on loan to West Brom, and Joe Willock to Newcastle later on Monday. The club are also open to allowing Reiss Nelson to depart if a suitable agreement can be found.
Arteta was coy on the details at a Monday morning news conference.
"[Deadline day] is what it is, at least when you know what you want to do, what you want to achieve, it is easier," he said. "Hopefully we won't have any bad surprises and we can control what we want to do."