Cavani signed a two-year contract when he joined Valencia after leaving Manchester United as a free agent last summer.
But after scoring seven goals in 28 appearances across all competitions last season, Cavani is on the move again.
The 36-year-old Uruguayan international has signed an 18-month contract with the Argentina giants after reaching an agreement with Valencia to end his deal prematurely.
Valencia only finished two points above the relegation zone last season.
A tweet from Los Che announcing Cavani's exit from the Mestalla Stadium read:
'Thank you for everything [Edinson Cavani].'
'Mestalla and Valencia will always be your home. Good luck with your new stage.'
Cavani's move to South America ends a 17-year stay in Europe, turning out also for the likes of Palermo, Napoli and Paris Saint Germain.
Cavani will wear the number 10 jersey at his new club.