The midfielder, 24, had made no secret of his desire to re-join Mikel Arteta's team after a successful debut season in north London.
Ceballos has already struck a deal with Arsenal, and the two clubs are expected to complete the move shortly.
The agreement will not include an option to sign permanently, and the finances of the move -- which have proved complicated given Arsenal's situation -- are now being finalised.
Ceballos impressed in the second half of the 2019-20 Premier League season, ending the campaign with 24 league appearances and starting in the FA Cup final win over Chelsea last month.
Coach Arteta has been in regular contact with Ceballos in recent weeks and that relationship is understood to be key to the player's decision to return to the Emirates, as well as his friendship with a number of Arsenal teammates.
"We have had some talks and Dani knows really well what I think about him," Arteta said recently. "He was pretty clear with me that his intention was to remain with us.
"He is a player that we are interested in because we really saw, in the last few months of the season, what he is capable of bringing to us."
By contrast, Ceballos' relationship with Madrid coach Zinedine Zidane has always been more difficult, as ESPN reported last month.
The midfielder began preseason training with Madrid on Monday but is now expected to fly to London soon to join up with Arsenal ahead of the new Premier League season.