The Rays originally acquired Aguilar from the Milwaukee Brewers in a July trade. He was designated for assignment Friday after Tampa Bay acquired Brian O'Grady from the Cincinnati Reds.
Aguilar appeared in 131 games with the Rays and Brewers last year and slashed .236/.325/.389 with 12 homers and 50 RBIs. He did not make the Rays' playoff roster.
The 29-year-old's best season came in 2018, when he was an All-Star for the Brewers and posted a .890 OPS with 35 homers, 25 doubles, and a 134 wRC+ over 566 plate appearances.
In Miami, Aguilar will likely battle Garrett Cooper for the starting job at first base.
Aguilar is entering his first year of arbitration and is projected by MLB Trade Rumors to earn $2.5 million in 2020. The Marlins will have to tender him a contract before Monday's 8 p.m. ET deadline.