David Cameron was widely reported to have made a “gaffe” this week when he was filmed telling the Queen: “We’ve got some leaders of some fantastically corrupt countries coming to Britain.”

The Prime Minister, who is hosting an anti-corruption summit in London, also described Afghanistan and Nigeria as “possibly the two most corrupt countries in the world”.

Politicians from those countries have hit back, with one Afghan member of parliament accusing Britain of having “a hand in spreading corruption in Afghanistan”.

Was Mr Cameron right to name and shame Afghanistan and Nigeria as corrupt – and is the United Kingdom partly to blame?

Britain's Queen Elizabeth speaks to Prime Minister David Cameron during a reception in Buckingham Palace to mark the the Queen's 90th Birthday, in London, Britain May 10, 2016. REUTERS/Paul Hackett - RTX2DMR1

Is David Cameron right?

Transparency International’s global Corruption Perceptions Index puts both Nigeria and Afghanistan near the bottom of the list, although it’s not quite accurate to call them “the two most corrupt countries in the world”.

Nigeria is in joint 136th place out of 167 rankings. Afghanistan is third from bottom after Somalia and North Korea.

Corruption is defined here as the “abuse of entrusted power for private gain”. That could mean a head of state stealing billions of oil revenue, or a local police officer demanding a bribe.

The index is based on the opinions of business people and expert analysis, an approach which has its critics.

Nigeria also scores badly in alternative international measures like the Open Budget Index – which measures governments’ transparency on public spending – and Global Integrity’s Money, Politics and Transparency research.

The West African country made headlines around the world in 2013 when the governor of Nigeria’s central bank claimed $20bn of oil revenue was missing from the national accounts.

Former president Goodluck Jonathan dismissed the allegation, but it was substantially confirmed in a PwC audit. More recent allegations include claims that $15bn was stolen in fraudulent arms contract when Mr Jonathan was in office.

Since 1999, when Nigeria regained democracy after decades of military rule, six state governors have been impeached over allegations of corruption.

An Asia Foundation study on corruption in Afghanistan reported a “high perception of corruption over the years, at all levels of government”.

Ordinary Afghans identified “70 types ranging from public administration and elected bodies to private sector, international aid, and the Taliban”.

In 2010 corruption led to the collapse of Afghanistan’s biggest bank, Kabul Bank, wiping out 5 to 6 per cent of the country’s GDP.

How corrupt is Britain?

According to Transparency International, Britain is in joint tenth place, making it one of the least corrupt countries in the world to live in.

But it’s important to remember that the index is measuring graft in the public sector not areas of activity like offshore finance, where Britain has a poor global reputation.

On financial secrecy, for example, the Tax Justice Network says the United Kingdom is the world’s biggest tax haven, if you include offshore finance centres in British overseas territories and crown dependencies.

Half the offshore companies exposed in the recent Panama Papers leak were incorporated in just one overseas territory: the British Virgin Islands.

Does Britain help or hinder corruption abroad?

Britain is hosting an international anti-corruption summit, but critics have long accused this country’s financial services sector of helping to facilitate corruption in countries like Nigeria.

Transparency International said in a recent report that the UK acts as a “safe haven” for corrupt individuals by allowing them to buy property anonymously through shell companies and tolerating offshore finance.

Global Witness has reported how British high street banks accepted millions in deposits from corrupt Nigerian governors in the early 2000s, even after being criticised by the banking regulator for helping the late Nigerian dictator Sani Abacha take around £1bn out of the country.

The British government is proposing changing the law so that offshore companies who buy property in the UK must reveal the beneficial owners.

From June, all UK companies will have to reveal who really controls them on a public register.

Afghan policemen stand guard at the site of a suicide bomb attack in an area near the Russian embassy in Kabul, Afghanistan January 20, 2016. REUTERS/Omar Sobhani - RTX238LJ

Why are Afghanistan and Nigeria so corrupt?

It’s complicated, but experts agree on some trends that help foster corruption in each country.

The Asia Foundation denied that corruption in Afghanistan was “cultural”, noting that many Afghans believe that there was less graft under the Taliban, the Islamist regime toppled after the US, Britain and others invaded the country in 2001.

Transparency International notes that the lowest scorers in its index were “characterised by bloody and entrenched conflict”. Five of the top 10 most corrupt countries rank among the 10 least peaceful places in the world.

A report commissioned by the US military found that American policy in Afghanistan, including its initial support for warlords, reliance on contracting for logistical support and massive military and aid spending “created an environment that fostered corruption”.

Corruption in Nigeria has variously been blamed on tribalism, the legacy of British colonialism, the “resource curse” of abundant oil and the country’s unstable history of war and military rule.

How much aid money does Britain give them?

Britain is due to donate about £679m to Afghanistan between 2013/14 and 2017/18.

The equivalent projected spend on projects in Nigeria is £1.1bn, although Nigeria’s economy is 25 times the size of the Afghan economy.

The Department for International Development says it has “robust monitoring approaches” to ensure the aid goes to the right places.

But the aid watchdog ICAI said in 2014 that there was little evidence a UK-funded scheme to combat police corruption in Nigeria had worked.