In the 30-second ad Beckham receives a phone call from his agent who tells him that Hart wants to come to stay with him to prepare for the part of Beckham in I Beckham, a fictional movie about the former footballer’s life.
A longer version of the film will launch online on 28 September. The global campaign will extend to TV and cinema on 30 September and will be supported by print and outdoor.
The campaign promotes the Modern Essentials selected by David Beckham autumn 2015 collection, a range of clothes chosen by Beckham as part of his long-term relationship with H&M.
Beckham said: "Kevin Hart is one of the funniest, smartest guys around. I love to do the unexpected for my H&M campaigns. I hope everyone enjoys watching it as much as I did making it."
In advance of the ad launching, Beckham and Hart shared pictures of themselves wearing the same clothes and standing or sitting in the same pose on social media to create a buzz around the campaign.
Campaign revealed Adam & Eve/DDB was working on a campaign for H&M starring Beckham last month.