The former Arsenal star made 25 starts for the Hammers after his £3million move from the Gunners last summer.
Scott Duxbury, West Ham CEO, said: "We respect Freddie Ljungberg's position and are pleased we could reach agreement and wish him all the best in the future. This deal is mutually acceptable to both parties."
Ljungberg said: "I gave my all at West Ham and enjoyed my time there but the decision is the best for the both of us.
"Now I will take my time to consider my football future."