David Cameron was caught on camera telling the Queen that leaders of some "fantastically corrupt" countries, including Nigeria and Afghanistan, were due to attend his anti-corruption summit.
The Prime Minister will host an international anti-corruption summit on Thursday aimed at stepping up global action to combat corruption in all walks of life.
In a pooled video feed made available to the ITN broadcaster, Mr Cameron was shown talking with the Queen about the summit.
"We had a very successful cabinet meeting this morning, talking about our anti-corruption summit," Mr Cameron said when the Queen approached.
"We have got the Nigerians - actually we have got some leaders of some fantastically corrupt countries coming to Britain."
Mr Cameron went on: "Nigeria and Afghanistan - possibly two of the most corrupt countries in the world."
The Queen did not respond to Cameron's comment but the Archbishop of Canterbury Justin Welby said: "But this particular president is actually not corrupt."
Nigeria's President Muhammadu Buhari and Afghan President Afghan President Ashraf Ghani, who are both planning to attend the summit, have acknowledged corruption in their countries and have pledged to clean it up.
Afghanistan is 166th, second-from-bottom, in campaign group Transparency International's latest Corruption Perceptions Index, an annual ranking of countries.
Only North Korea and Somalia, jointly ranked 167th, are perceived to be more corrupt. Nigeria is 136th in the index.
It was not clear whether Mr Cameron realised he was being filmed at the Buckingham Palace event.
Number 10 declined to comment directly on the premier's conversations with the Queen but pointed out that the leaders of both countries had acknowledged the scale of the problem they faced.
Mr Ghani and Mr Buhari have written essays for a book accompanying the summit.
Mr Ghani, they said, acknowledges in his piece that Afghanistan is "one of the most corrupt countries on earth" and Mr Buhari that corruption became a "way of life" in his country under "supposedly accountable democratic governments".
According to Reuters, a bystander joked to Mr Cameron: "They are coming at their own expense one assumes?"
"Everything has to be open," the prime minister replied. "There are no sort of closed-door sessions. Everything has to be in front of the press. It's going to be...It could be quite interesting."
Mr Cameron had earlier said it was "very exciting" to mark the Queen's 90th birthday with an "array" of political figures at a party at Buckingham Palace today.
Representatives from both Houses of Parliament and from across the political spectrum attended the event.
But Labour leader Jeremy Corbyn, a noted republican who kicked off Labour's In For Britain EU campaign on Tuesday, missed the engagement.
He was attending a family funeral instead, and a Buckingham Palace spokesman said he had "personally written" to the Queen explaining his absence.
Wearing a blue and white floral day dress, the Queen, who has broken records with her 64-year reign, met the political figures from both the Lords and the Commons in the Palace's White Drawing Room.
Mr Cameron's gaffe is not the first time he has been caught on film. In 2014, he was filmed telling New York's mayor that the Queen had "purred down the line" after he had called her to say Scotland had rejected independence.