The 29-year-old joined Milan on loan in January 2014 after falling out of favour at Sevilla's La Liga rivals Valencia and the move was later made permanent.
However, Rami had a frustrating, injury-hampered season, starting only 18 Serie A matches for Milan who failed to qualify for Europe.
Sevilla said Rami still has to undergo a medical and that "If everything goes as predicted, his contract will be for four seasons."
A tough-tackling defender who is strong in the air, Rami made the last of his 26 appearances for France in 2013.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Valencia opened disciplinary proceedings against Rami after he criticised then-coach Miroslav Djukic and his team mates in an interview with Spanish radio and he was suspended for a week without pay.
(Writing by Brian Homewood in Berne, editing by Ed Osmond)
