The 24-year-old leaves the club amid links with Arsenal, having recently guided West Ham to the Europa Conference League title and a 14th-place finish in the English top flight.
"We promised him he could go. He set his heart on going. You can't ask for a man who has committed more to us this season. In due course, he has to get on and we have to get a replacement, or several replacements.
West Ham were celebrating on Friday after rising teenage star Declan Rice signed a new long-term contract with the Premier League club.