Jack Wilshere has been released by West Ham after making 19 appearances in just over two years with the club.
The Hammers say they have reached an agreement over the remainder of his contract, which has nine months left.
The England midfielder, 28, joined the Hammers on a three-year deal in July 2018 after leaving Arsenal.
But injury problems that badly affected his career with the Gunners continued, restricting him to just 16 Premier League appearances for West Ham.
He has played once this season, in the 5-1 victory over League Two Hull in the Carabao Cup.
An extremely talented player, Wilshere made 197 first-team appearances for Arsenal and was part of the 2014 and 2015 FA Cup-winning sides.
He has 34 England caps, the last of which came in the 2-1 defeat by Iceland in the 2016 European Championship last 16.
In transfer news, West Ham are interested in taking Chelsea centre-back Fikayo Tomori on loan.
But it will depend on whether Chelsea decide to let him go and what they decide on Antonio Rudiger who has been linked with a move away from Stamford Bridge.
Germany international Rudiger, 27, has already turned down a move to West Ham.
West Ham winger Felipe Anderson could also be loaned to Porto.
The Portuguese transfer window closes on 25 October, but Porto would need to register the 27-year-old Brazilian by Tuesday if they want him to play in Champions League games this season.