The deal will see the England international spend two months at San Siro before returning to Los Angeles Galaxy in March ahead of the MLS season.
Sporting director Umberto Gandini confirmed the contract was open-ended but expects Beckham to return to the US after two months.
"He is committed to Los Angeles Galaxy and the MLS and he thanks them for the opportunity to train with us."
"Only David knows his future, but he has a commitment to LA Galaxy and I think he will respect that."
Beckham's signing ceremony will be in two weeks and he will officially join Milan's squad on December 21 ahead of their winter training camp held in Dubai on the 29th.