The 38-year-old, possibly playing the final match of his second stint at the club, took his tally to 10 league goals since returning in January and became the oldest player to score 10 or more goals in a Serie A season.
The Swede's contract ended with Saturday's match although he could extend it into next season according to some Italian media reports.
AC Milan went ahead with an own goal by Ragnar Klavan in the 11th minute. Rafael Leao hit the post from a narrow angle but the ball bounced off the Estonian defender and into the net.
Leao also rattled the crossbar before Milan were awarded a penalty for handball by Sebastian Walukiewicz one minute before halftime. However, Ibrahimovic's spot kick was saved by Alessio Cragno.
Ibrahimovic made amends when he scored with an emphatic finish from Samu Castillejo's pass in the 55th minute, and Castillejo exchanged passes with Giacoma Bonaventura to score the third two minutes later.
Milan, unbeaten since the season restarted in June, finished sixth with 66 points and will play in the Europa League qualifying rounds next season.
Barcelona and Manchester City plot surprise summer swap deal - Euro Papers