The three-time Champions League-winning boss announced his decision at an impromptu press conference at 12 noon BST on Thursday.
“The team needs to continue winning and needs a change,” he said.
The former Real, Juventus and Bordeaux midfielder made Champions League history when he led his side to three consecutive titles earlier this month. He is one of only three managers, along with Carlo Ancelotti and Bob Paisley, to have secured three European successes.
Zidane was under contract until 2020 but called time on his spell in charge after a third place finish in La Liga, behind Barcelona and City rivals Atletico Madrid.
Zidane leaves the club having NEVER lost a European knockout tie. He won 104 of his 149 games in charge and won one La Liga title, one Spanish Super Cup, two UEFA Super Cups and two Club World titles to go with his three Champions League crowns.
That’s a total of nine trophies – an average of a trophy every 16.6 matches.