Ibrahimović was out of contract with the Serie A club at the end of the season and Milan had already announced there would be a special ceremony after its match against Hellas Verona to bid farewell to the 41-year-old Swede.
But Ibrahimović later revealed in a news conference that no one knew the big news he was about to drop.
"Even my family didn't know, because I wanted that when I announced it, everyone heard it at the same time," he said.
Ibrahimović was given a guard of honour by his teammates as he walked out after the match at San Siro.