The Swede has signed the new deal despite facing the prospect of a lengthy rehabilitation process from knee surgery.
The 40-year-old is expected to be out for up to eight months and is unlikely to be match fit until midway through the 2022/23 campaign.
Nevertheless, AC Milan confirmed the news on Monday saying in a statement: "AC Milan is pleased to announce the renewal of Zlatan Ibrahimovic's contract until June 30, 2023," a club statement read.
"The Swedish forward will continue to wear the number 11 shirt."
Responding to the announcement on his Instagram page, Ibrahimovic wrote: "The never-ending Zlatan #ReadyToLeaveAMark".
Ibrahimovic scored eight goals last season as AC Milan won their first Scudetto in 11 years. While that may have been his lowest scoring season since 2005/06, his influence away from the field was instrumental as Rossoneri powered to the title.
Throughout his illustrious career, the player has scored 510 goals in 862 outings. He also holds a rare achievement after scoring goals across four separate decades - 1990s, 2000s, 2010s and 2020s.
Ibrahimovic made a name for himself at Malmo FF where he bagged 18 goals in 47 competitive appearances.
A move to Ajax followed as he helped the Dutch giants to two league titles and two domestic cups.
After lighting up the Eredivisie with 35 goals in 74 games, the player made his first move to Serie A as he linked up with Juventus.
A two-year spell with the Old Lady was followed by a move to Inter Milan where the Swede bagged 66 goals in 117 appearances. The player also claimed three league titles and two domestic cups.
Ibrahimovic was lured to Barcelona for the 2009/10 campaign, but a fractious relationship with Pep Guardiola meant the Swede quickly returned to Italy, joining Inter's fierce rivals AC Milan.
Ibra has since featured at PSG, Manchester United and LA Galaxy, before returning to the San Siro in the 2019/20 season.