The Rossoneri missed out on Champions League qualification on Sunday despite a season-ending 3-2 victory against SPAL.
And former Milan midfielder Gattuso, whose contract runs until 2021, has confirmed he is leaving the club and will not be taking any compensation.
“Deciding to leave Milan’s bench is not easy but it’s a decision I had to make,” he said, according to Italian newspaper Repubblica.
“There was not a precise moment in which I decided, it was the sum of these 18 months as coach of a team that for me will never be like the others. Months that I lived with great passion, unforgettable months.
“Mine is a painful but thoughtful choice.
“Am I giving up a two-year contract? Yes, because my story with Milan can never be a question of money.”
Gattuso took the role in November 2017 after a spell as youth-team coach.
Milan’s fifth-placed finish in Serie A this season was their highest since the 2012/13 campaign.