The new contract for the 25-year-old represented "a landmark day" for Marlins owner Jeffrey Loria.
The value of the deal makes it a record, although the £187m ($292m) 10-year contract signed by Detroit's Miguel Cabrera is worth more annually.
Stanton has hit a total of 154 home runs in five Major League seasons.
The American outfielder missed the final 17 games of last season after being struck in the face by a pitch but still hit 37 home runs in 2014, the most in the National League.
"I'm happy for the city, I'm happy for him and I'm thrilled for baseball," added Loria, who said the deal includes a no-trade clause and allows Stanton to opt out after six years.
"Besides being a terrific athlete, he's a first-class young man. I've loved watching him play, but I love this kid. He's just a special young man."
Giancarlo Stanton has agreed the most expensive ever deal in United States sport by signing a £208m ($325m) 13-year contract with Miami Marlins.