The 25-year-old had been linked with a move to the blue and black side of San Siro for much of deadline day.
However, their city neighbours swooped to secure their man on a five-year contract.
The move continued a dramatic day for Milan, who also signed Chelsea's Marco van Ginkel on a season-long loan.
It then appeared they had secured a move for Parma's Jonathan Biabiany, who was officially welcomed on the club's Twitter feed.
Yet they were ultimately forced to delete the tweet with reports saying Cristian Zaccardo, who was set to move in the other direction, refused to rejoin his former club.
Any disappointment at that evaporated, however, as Milan completed a deal for Inter target Bonaventura.
Get the best features, fun and footballing frolics straight to your inbox every week.