The 24-year-old spent the 2019-20 season with Arsenal and made clear that he wanted another season with the north London side.
Sources told ESPN that Mikel Arteta had been in regular contact with Ceballos during the summer break and it was a combination of that and his friendship with a number of his teammates that convinced him to stay with the Gunners.
After the deal was announced, Arteta said: "Dani was and integral part of our team last season and finished the season in excellent form. I love Dani's passion and commitment and he's a highly skilful player. We're all delighted to welcome him back and we look forward to seeing him pick up where he left off."
Ceballos began preseason training with Madrid but subsequently flew to London to meet up with Arsenal ahead of their first Premier League game against Fulham on Sept. 12.
Technical director Edu added: "We're thrilled to have Dani back with us for the new season. We all know his qualities after an impressive 2019/2020 campaign, which ended with him playing a key role in our FA Cup success. We're excited to add Dani to the list of quality players we are bringing in."