"We looked at the future of Juventus and the club decided to move in a different direction next year without me," the 51-year-old told a press conference at the Allianz Stadium.
"But that doesn't change anything. We have grown together and it is the right moment to leave the club in the best possible way."
Juventus have already wrapped up their record eighth consecutive title, which was Allegri's fifth in as many years. He also lifted the Coppa Italia on four occasions since replacing Antonio Conte in 2014, and reached two Champions League finals.
The former AC Milan and Cagliari boss -- who had one year left on his contract -- said he accepted the club's decision as he tried not to cry in front of his team, who were sat in the front rows of the press conference.
"In professional life, there are times when we separate," he said.
The split comes after a reported spat with directors including former Juventus legend Pavel Nedved and Fabio Paratici over what direction the club should be taking.
Despite signing Cristiano Ronaldo from Real Madrid last summer the Bianconeri failed to make it past the quarter-finals of the Champions League for the second successive season.
They were humiliated by modest-spending Ajax despite a star-studded side including Ronaldo, Argentina's Paulo Dybala and French World Cup winner Blaise Matuidi.
The pressure to bring the much-desired trophy back to Turin for the first time since 1996 was also alleged to be part of the fall-out, and club chairman Andrea Agnelli said the final decision had been his.
"This was the most difficult decision I have made during my time at Juventus," said Agnelli, who sat alongside Allegri in the press conference.
"After the defeat against Ajax, I was sincerely thinking of continuing with Max.
"It was hard to understand together that it was the right time to bring an end to one of the most extraordinary cycles in Juve's history."
Agnelli refused to answer questions concerning the next coach, while Allegri remained vague about his future.
"I don't know, we'll see, maybe a break would be good for me, but maybe as early as July 15, I'd like to go back in," he said.
"It's going to depend on me, what's going on. I have to evaluate the things that will be offered to me."
Allegri's final home match in charge with be Sunday's Serie A clash against Atalanta.
"Tomorrow, we have to celebrate ... We have to celebrate because these last five years have been absolutely wonderful."