A photograph of Cameron and Obama leaning in and smiling broadly for a smartphone snap taken Tuesday by Danish Prime Minister Helle Thorning-Schmidt has caused a storm on social media.
Asked about the picture during his weekly question and answer session in the House of Commons, Cameron quipped that "you should always remember that the television cameras are always on".
The Conservative leader also joked that he was building political bridges, a reference to Thorning-Schmidt's marriage to the son of Neil Kinnock, the former leader of the Tories' arch-rivals Labour.
Thorning-Schmidt told Danish daily Berlingske the "selfie" showed they were "just people".
"It wasn't inappropriate. There were lots of pictures taken that day, and I just thought it was a bit fun.
"Maybe it also shows that when we meet heads of state and government, we too are just people who have fun," she added.
"There was a sadness, but it was basically a festive event that also celebrated a man who has lived for 95 years and achieved so much in his life," Thorning-Schmidt said.
"There was dancing on the stands... And then we took a really fun selfie."
In a tongue-in-cheek question, British lawmaker Martin Horwood noted EU efforts to abolish expensive mobile phone roaming charges.
"Has the prime minister had the opportunity to discuss international mobile phone usage with any European heads of government in the last day or so?" he asked.
To laughs in the chamber, Cameron replied: "You could say in a roundabout way, and, er, perhaps in my defence, you should always remember that the television cameras are always on.
"But in my defence I'd say that Nelson Mandela played an extraordinary role in his life and in his death in bringing people together.
"And so of course when a member of the Kinnock family asked me for a photograph I thought it was only polite to say yes."