The 33-year-old Senegal international was a free agent after being released by AEK Athens, who he joined in 2010.
He has agreed a one-year contract with the Championship outfit, which includes the option of an additional 12 months.
"I am very happy, It is good to be here," said the imposing 6ft 5 midfielder. "I want to help West Ham go up and hope we can be successful.
"English football is the best in the world. I have come here to work hard and give 100% in every game I play for West Ham. I want to show people I am back again."