The prime minister made the remarks before the anti-corruption summit tomorrow, at which Nigeria's president, Muhammadu Buhari, will deliver a keynote address entitled "Why we must tackle corruption together".
Cameron who will be the host of the summit was overheard telling the monarch that "leaders of some fantastically corrupt countries" would be attending the meeting, before singling out the two nations.
"Nigeria and Afghanistan, possibly the two most corrupt countries in the world," he added.
A spokesman for Buhari, who won elections last year vowing to fight corruption, said he was deeply "shocked and embarrassed" by the comments, which he assumed must refer to problems in Nigeria that pre-dated his presidency, Guardian reported.
An official in the Afghan embassy described the intervention as "unfair", arguing the country had made important progress in this area.
