The Sweden striker, who turns 40 in October, has been credited with turning Milan into title contenders again since his return to the club in January last year.
"AC Milan is the club for which Zlatan has played the most in Italy," the club said in a statement. "After scoring 84 goals in 130 appearances with the Rossoneri, the Swedish striker will continue to be wearing the red and black jersey next season."
Ibrahimovic, who helped Milan to their last Serie A title in 2011, is the club's top scorer with 15 goals in 17 games having missed others through injury and illness. He missed the club's midweek defeat to Sassuolo which leaves second-placed Milan 10 points behind city rivals Inter.
The former Manchester United, Paris Saint-Germain and Barcelona forward's current deal had run until the end of the season. The Swede returned to the national team last month, more than five years after calling time on his international career.
Milan are targeting a return to the Champions League for the first time since the 20113-2014 season.
Standout matches today