The 56-year-old was appointed Milan manager in October 2019, replacing Marco Giampaolo after a difficult start to the season.
Pioli has since guided Milan back into the Champions League after a seven-year absence by finishing second last season.
The former Fiorentina manager has once again impressed in Serie A this term, with the Rosonerri sitting pretty in second position, behind leaders Napoli only on goal difference.
"I want to thank the Club for having given me the chance to coach a competitive team and one that is replete with great values, which must never go missing and which make AC Milan special, Pioli said after signing his extension.
“I'm proud of the work we've done until now, with the good relationship I have with the management, with the growth of my players and with the passion displayed by everyone working at this incredible Club.
“Our fans are extraordinary and I hope to return their affection by making AC Milan more and more competitive."
Director Paulo Maldini added:"There is a thrill of continuing a path that is bringing us great results.
"We don't want a team to win for just one year, but for a long time. We want to bring Milan back to being competitive."
"We do not renew only with the coach Pioli, but also with the person. There is great harmony between us, there may be problems, but we will know how to overcome them."