Celebrities including Strictly co-host Claudia Winkleman, 43, who used budget airline EasyJet, TV chef Gordon Ramsay, his wife Tana, Hollywood actress Eva Longoria, 40, and hairdresser Jason Collier - who no doubt ensured tresses were camera-ready for Instagram - all found themselves on the invited list.
Mrs Beckham's former Spice Girls band members, Melanie Chisholm, 41, Emma Bunton, 39 and Geri Halliwell, 42, also made an appearance but Mel Brown, 39, was notably absent. It has been rumoured in the past that Mrs Beckham, 41, does not approve of Miss Brown's husband Stephen Belafonte, 39. It was left to Miss Longoria to make up for Miss Brown by dubbing herself 'Latina Spice' in pictures posted.
Beckham was presented with not one but four Red Velvet (his favourite) birthday cakes - one from each of his children Brooklyn, 16, Romeo, 12, Cruz, 10, and Harper, three.
The children left birthday messages for their father in icing on the vanilla cakes which were made with fresh berries by staff at the hotel.
Beckham's birthday party was held in a Berber tent in the grounds of the luxury resort and saw family and friends dine on traditional Moroccan food including monkfish tagine and whole lambs roasted in holes dug in the earth.
Sources claim the Beckhams paid £27,200 (NZ$54,726) upfront for the evening event for 60 guests - but the total bill for the exclusive hire of the hotel will run to considerably more, with some luxury rooms costing £2,500 (NZ$5,030) per night.
Entertainment was provided by local dancers, traditional folklore musicians and a flock of camels. Over 200 staff were on duty to cater to their every wish.
Ever the sportsman, Beckham requested television screens were installed so guests could stay up late to watch the boxing match branded the "fight of the century" between Mayweather Jnr vs Pacquiao live from Las Vegas, which did not start until 4am.
To perk up guests after a long evening of drinking and dancing, shawarmas (Moroccan kebabs) and sandwiches were served in the small hours.
Security was tight around the resort during the weekend, with bodyguards inside the hotel and armed police stationed at the entrance.
The five-star venue, which was used in the Sex and the City 2 film, is a favourite of Beckham and his wife, who reportedly renewed their wedding vows there back in 2004 and have visited several times as the sportsman believes it is an auspicious venue.
A source at the hotel said the couple know the staff on first name terms and Beckham has even acquired his very own butler.
He said: "Beckham believes that visiting the hotel brings him good luck and makes his wishes come true. That is why he keeps going back. He always has a good time."
However the steady flow of pictures on Instagram and messages suggested Beckham's birthday was deliberately chosen to tie in with his use of Instagram to ensure his arrival on the picture-sharing site was done in a blaze of glory and provided a boost for Brand Beckham.
The snap of him in bed was accompanied with the message: "It's great to finally be on Instagram, been a long time coming but I can't wait to start sharing all my special moments with you."
Mrs Beckham coined the hashtag #DB40 ahead of the celebrations, suggesting some thought had gone into a social media strategy for the big day.
Beckham has amassed a staggering 3.7million followers on Instagram.
His teenage son Brooklyn also benefited, reaching 2million followers on Instagram - doubling the 1million mark he passed on his mum's birthday just two weeks ago.
Sources said Mrs Beckham, who orchestrated the event, kept a close eye on the photographs that were sent out and appeared anxious that all should go to plan: "She and David are in the best place that they've been as a couple. She's earned his admiration and respect as a businesswoman with her own success and his retirement has meant that he's more involved with the family and she loves that. They have never been happier as a couple."
Posting a selfie of himself with his fashion designer wife at the end of the evening, Beckham's message read simply: "Thanks to my beautiful wife for such an amazing day x."
- Daily Mail