The central defender, who has the option to sign for another season, had not featured for Southampton since handing in a transfer request earlier this month.
The south-coast club claimed he had repeatedly rejected improved terms but Fonte, who had 18 months left on his deal, countered that he had not been offered a new contract.
He moved to Crystal Palace from Benfica in 2007 and joined Southampton in 2010, making 288 appearances, including 154 in the Premier League. He was captain for the past 3-1/2 seasons.
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.
Fonte, who has family in London, said the size of West Ham and their passionate fans attracted him to the club along with the fact that manager Slaven Bilic was keen to sign him.
"The manager was... a very big influence. I thought that he really wanted me and that he sold me the project and the ambition of the club," he told the club website (www.whufc.com).
“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..."
Fonte will not be available for Saturday’s league game at Middlesbrough but could make his debut for West Ham when Manchester City visit the London Stadium on Feb. 1.
(Writing by Ken Ferris; editing by Pritha Sarkar)
