The 34-year-old Los Angeles Galaxy midfielder will join up with the Serie A side once the Major League Soccer season is finished.
The move had long been expected and has now been confirmed by the Italian club.
Beckham said: 'I need to give myself the best chance possible to make the World Cup squad and playing for Milan on loan will help me to do that.
'I genuinely enjoyed my time at Milan and I look forward to meeting the players and staff again.
'I'm committed to LA Galaxy and MLS in the long term and remain as passionate as ever about growing the game of soccer in America.
'I'm completely focused on ending this season on a high note with my club by winning the MLS Cup.'
Beckham spent the second half of last season on loan at AC Milan and is returning to Serie A to maintain his form and fitness and try to secure his place in England's squad for the World Cup finals in South Africa next year.
The former Manchester United midfielder scored two goals in 18 matches in his first spell at the San Siro.
He will be eligible to play for Milan from January till the end of the season and will hope to be involved in the knockout stages of the Champions League. His debut could be against Genoa at the San Siro on January 6.
Milan managing director Adriano Galliani said: 'We are very happy to see again David Beckham with the Rossoneri jersey after the splendid experience of last season.
'We are certain that this time in Europe will help the player take part in the next World Cup and to continue after his career in Los Angeles Galaxy, to whom we thank for their time.
Los Angeles Galaxy's David Beckham
American mission: Beckham has plenty of work to finish with LA Galaxy before he can move to Milan
'We are confident his loan spell will not only improve Milan, it will help the player to take part in the World Cup in South Africa and continue to enhance his career in North America with the LA Galaxy.
'We would like to thank the Galaxy and MLS for their co-operation and understanding.'
The veteran must fist complete a season with the Galaxy that sees them in contention for the MLS Cup.
Beckham helped LA to a 2-2 draw against Chivas at the weekend and victory in the second leg would put his side in the Western Conference Final - a two-leg semi-final for a place in the MLS Cup final on November 22.
Beckham will also be expected to appear in a friendly against Kaiserslautern on November 26 and another showpiece match may be lined up before he can join up with Milan, officially on December 28.
Galaxy head coach and general manager Bruce Arena said: 'We are pleased to finalise David's loan to AC Milan and we look forward to his return to the Galaxy after the 2010 World Cup.'
Chelsea and Tottenham Hotspur had expressed an interest in signing the Leytonstone-born star, but a return to the most decorated team in Italy had always been his first choice.
Joining him at the San Siro this winter will be highly rated Ghana forward Dominic Adiyiah, according to Milan managing director Adriano Galliani.
The 20-year-old plays for Norway's Fredrikstad FK and stole the show in the recent Under-20 World Cup by leading his team to glory in Egypt.
"We are making moves in the transfer market and I can say that we have signed the young Ghanaian Dominic Adiyiah," Galliani told the AC Milan TV channel.
"We have an agreement with Fredrikstad FK.
"Now the player needs the work permit to enter Italy and we will deposit the contract on January 1.
"He will have to pass a medical and then he will be a Milan player."
Adiyiah won the FIFA Golden Shoe and Golden Ball awards after scoring eight goals in seven games in Ghana's historic victory.
"He is a forward that can play in place of (Alexandre) Pato and Ronaldinho," added Galliani.