Chelsea and Spain striker Fernando Torres will join AC Milan on a permanent basis on January 5.
Torres, 30, moved to the Serie A club on a two-year loan deal in August and will now make his move permanent.
He will be loaned out to former club Atletico Madrid next month, with Italy winger Alessio Cerci, 27, arriving from the Spanish side.
Torres joined Chelsea from Liverpool for a then British record transfer fee of £50m in January 2011.
The striker helped win the Champions League, Europa League and FA Cup while at Chelsea.
In a statement, Chelsea thanked the 2010 World Cup winner for “his service during the past four seasons” and wished him “the very best for the future”.
Torres had been linked with a return to boyhood club Atletico Madrid after the Spanish champions’ president hinted at a deal earlier this month.
Earlier on Saturday, Atletico assistant coach German Burgos also said a deal was “on the verge of completion”.
“He will be a very important reinforcement for the second half of the season,” Diego Simeone’s number two told Spanish media.
Torres left Atletico for Liverpool in 2007.