After word got out the global sporting icon was inside the 99 Hanover Street bar, more than 200 fans besieged the area hoping for a glimpse of their idol.
Former England and Manchester United star Beckham was filming for the launch of the new Haig Club Scotch whisky which will go on sale later this year.
Security guards stood at the entrance to the bar. The windows had been blacked out, while a double row of black curtains at the door provided the crowd with occasional tantalising views inside.
Among the fans was tourist Meshal Albattah, 28, an engineer from Saudi Arabi.
“I’m a very, very big fan of Beckham and I’ve never seen him in real life and really wanted to take his picture. He’s different from other footballers because he’s using his celebrity in a good way by being commercial and doing charity work.”
Donald Inwood, 18, a sixth year pupil at Edinburgh Academy, and some fellow pupils, had secured a first-class vantage point from the bus stop in front of the bar.
“A friend told me David Beckham was here so I thought I’d come down in my lunch break. Beckham’s retired from football but he’s got a reputation as a good guy.”
Shortly before 4pm there was a frenzied burst of excitement as Beckham flashed his famous smile, before retreating back inside away from the mob desperate for photos and autographs.
A spokesman for drinks company Diagio said: “David is in Scotland for business on Haig Club, a single grain Scotch whisky to be launched later this year.”