The 24-year-old scored 20 goals to help Metz win Ligue 2 last season and has signed a four-year contract with Sam Allardyce’s side. Goal understands the agreed fee for the player is £4.5 million.
On Tuesday evening, Metz announced that they had pulled the plug on the deal after claiming West Ham had altered the terms of the transfer in the final stages of negotiations.
The French club also threatened West Ham with legal action after Sakho had travelled to England for a medical and subsequently missed their Ligue 1 season opener against Lille on Saturday.
"This is a proud day to have signed for West Ham, I really love English football and I've dreamed of coming to play for one of the big English clubs. Today, West Ham have given me that opportunity and I didn't hesitate to grab it,” Sakho told West Ham’s official website.
"I'm looking forward to playing. It's more than a month now that I've been training for this and right now I think I'd be ready to pull on the Club colours.
"I've come here to continue as I was at Metz. I'm going to give it my all, going flat out on the pitch and I think the fans will appreciate that."
Sakho is Allardyce's seventh signing this summer following the arrivals of Mauro Zarate, Cheikhou Kouyate, Aaron Cresswell, Diego Poyet, Enner Valencia and Carl Jenkinson.