The French centre-back made 18 Serie A appearances for Milan last season after making a loan move to San Siro in January.
And he will return to the club ahead of the 2014-15 campaign after a deal with the Liga outfit was confirmed on Saturday.
Rami has put pen to paper on a contract until the end of June 2017 and will play his part in a new era under Filippo Inzaghi.
The 28-year-old, who has 26 France caps to his name, had made no secret of his desire to stay with Milan after a turbulent spell with Valencia - which included a fall-out with pervious coach Miroslav Djukic.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.