He hosted a rooftop pool party in east London with guests including the singer Ellie Goulding and One Direction's Liam Payne and Niall Horan.
Beckham launched his Bodywear collection for H&M in 2012, with new styles, fabrics and patterns following in the years since, and the retailer said the addition of swimwear was "a natural progression".
Loading article content
H&M said: "As with all previous ranges, the focus of the swimwear collection is on fit, performance and comfort and offers a fresh update on classic masculine style."
The new range of boardshorts, swim shorts and trunks will launch in selected stores and online from May 22.