The 33-year-old, who won Euro 2016 with Portugal last summer, has put pen to paper on a two-and-half-year deal, with the option of a further year.
Fonte told West Ham's official website: "I signed for West Ham because they are a great club and a very big club. They have a lot of fans and I have known for a number of years how passionate they are."
Fonte made 288 appearances in his seven-year spell at St Mary's and was the last remaining member of the Saints side that rose from League One to the Premier League.
The centre-back was linked with a number of clubs following Portugal's triumph in France but has opted to move to London Stadium and admitted Hammers boss Slaven Bilic played a big part in his decision.
He added: "The manager was also a very big influence. I thought that he really wanted me and that he sold me the project and the ambition of the club.
"I also have part of my family living in London and they are big West Ham fans. It just made sense for me at this stage to join West Ham.
"It is a new challenge and a new beginning and I am looking forward to it.
"With the way that West Ham is going we can only look to be challenging in the top eight.
"West Ham are a massive club and it is an exciting challenge and it should be for everyone. We all need to get together and start working."
The Hammers confirmed Fonte will not be available for Saturday's trip to Middlesbrough.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies