"It's scary, it really is scary, you feel it. Just yesterday one of the troops was killed, and you feel it and you see the flags at half-mast and you feel the tension there.
"These guys are the bravest people that I've ever met and it really is, it truly is, an honour to be here."
He added: "I've been wanting to come for years, but with my playing schedule I've never had the time.
"But obviously being injured now it's given me the chance to do things I've always wanted to do and never been able to. I'd love to come back."
Asked if he would have considered a military career had he not become a footballer, Beckham said: "Without a doubt... I've represented my country many times on the field, but what these guys do representing our country is really amazing."
Beckham posed for pictures, signed autographs, took part in a question and answer session with troops and visited Camp Bastion's hospital.
He also got a lesson in weapon handling and joined senior officers cooling off in a paddling pool as temperatures in the camp reaching 45C (113F).
During a penalty challenge with troops he scored with his only attempt.
The footballer made his name at Manchester United before going on to play for Real Madrid, Los Angeles Galaxy and AC Milan.
The UK force level in Afghanistan is currently 9,500, but with special forces totals some 10,000.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.