Foreign Secretary Philip Hammond has praised the Nigerian president's "strong leadership", days after David Cameron was overheard calling the country "fantastically corrupt".
Mr Hammond made the remark during a visit to Nigeria where he praised President Muhammadu Buhari's approach to fighting terror group Boko Haram.
On Tuesday Mr Cameron was caught on camera making the unflattering comment during a conversation with the Queen ahead of an anti-corruption summit.
"We've got some leaders of some fantastically corrupt countries coming to Britain," Mr Cameron told the Queen. "Nigeria and Afghanistan - possibly the two most corrupt countries in the world."
Mr Buhari's spokesman Garba Shehu called the comments "embarrassing".
In a statement on social media, he wrote: "This is embarrassing to us, to us say the least, given the good work that the president is doing. The eyes of the world are on what is happening here. The Prime Minister must be looking at an old snapshot of Nigeria. Things are changing with corruption and everything else."
Following the incident, a Downing Street spokesman said: "Both leaders have been invited to the summit because they are driving the fight against corruption in their countries. The UK stands shoulder to shoulder with them as they do so."
Mr Hammond is in Abuja, Nigeria, for a security summit where he restated Britain's support for the country in the fight against Boko Haram.
The Foreign Secretary said: "President Buhari has shown strong leadership in the fight against Boko Haram, a brutal organisation that has raped, murdered and kidnapped innocent civilians and forced over two million people to flee their homes. Their allegiance to, and potential coordination with Daesh is a reminder of the threat they present to the region and to British interests.
"Britain and Nigeria, with support from the US, France, and its neighbours, are making progress in degrading Boko Haram, but we must maintain the momentum to win the war, and build the right conditions for post-conflict stability in the region."
Two years ago, the Islamic extremists seized 276 girls who had gathered for science exams at the Government Girls Secondary School in Chibok. Some managed to escape, jumping off pick-up trucks as the Islamic extremists drove them toward the Sambisa Forest.
The UK will give Nigeria nearly £40m of counter-terrorist and counter-extremism support over the next four years, including training almost 1,000 military personnel.