Ibrahimovic has struggled with a knee injury in recent months, last playing the full 90 minutes for the Italian side in January.
The 40-year-old celebrated his second Serie A title with Milan, playing the last 18 minutes of the final game against Sassuolo on Sunday as they pipped rivals Inter to the title by two points.
"The arthroscopy had been planned for a while to definitively resolve the joint's instability through the reconstruction of the anterior cruciate ligament, with lateral reinforcement and meniscus reparation," Milan said in a statement.
"The operation was a complete success and the prognosis is estimated between seven and eight months."
Ibrahimovic, Sweden's top scorer with 62 goals, was not named in the national team for next month's UEFA Nations League matches.
He had initially retired from the Swedish national team after Euro 2016, but returned for their World Cup qualifiers in 2021.