Benatia, 31, leaves Europe for the first time in his career, with Juve confirming the move.
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.
Benatia initially arrived at Juve on loan from Bayern Munich in 2016 before the club made the move permanent the following year.
The Morocco international won two Serie A titles and two Coppa Italia crowns during his time with the club.
Al-Duhail are six-time top-flight champion in Qatar and sit second through 15 games this season, now strengthening what is already the best defence in the competition.