Benatia, 31, leaves Europe for the first time in his career, with Juve confirming the move on Monday.
The fee is expected to be paid in two instalments by October 2019 and may increase a further €2m, the club said in a statement.
Juventus wished Benatia the best on Twitter, with the defender replying with his regards and hopes he can watch his former club in Madrid when they face Atletico in the Champions League last 16.
"Thank you all," Benatia wrote. "It has been an immense pleasure! I hope to be able to come to Madrid to cheer for you - this Juve deserves it."
Benatia initially arrived at Juve on loan from Bayern Munich in 2016 before the club made the move permanent the following year.
Grazie a tutti voi 🙏🏽e stato in immenso piacere !spero di potere venire a Madrid a tifare per voi 👌🏽🤲🏽questa juve se lo merita 👌🏽— MBenatia5 (@MedhiBenatia) January 28, 2019
Prior to Juve, Benatia had spent the much of his career in Serie A, after beginning his career in France.
A move to the capital followed, and after a successful season that saw him start 32 games for a Roma side that finished second to Juventus in Serie A, Benatia joined Bayern Munich.
He would win two Bundesliga titles and a DFB Pokal in his two seasons with the Bundesliga giants before his return to Italy with Juve.
Al-Duhail are six-time top-flight champions in Qatar and sit second through 15 games this season, now strengthening what is already the best defence in the competition.