President Obama
President Obama, Danish Prime Minister Helle Thorning-Schmidt and David Cameron were caught committing a funeral faux pas — snapping a selfie.

President Obama has come under fire after he was caught taking a selfie with Danish prime minister Helle Thorning-Schmidt and David Cameron at Nelson Mandela's memorial service.

The trio committed a diplomatic faux pas at the official memorial ceremony which was attended by 90,000 people and dozens of world leaders, celebrities and models and broadcast around the world.

In AFP photographer Roberto Schmidt's image, which is making the rounds online, the threesome can be seen smiling and squeezing into the frame while Thorning-Schmidt holds her smartphone out to capture the moment.

An unimpressed Michelle Obama sits in the distance with a look of as disapproval etched on her face.

A fierce backlash has been sparked among the online community who accused the trio of being disrespectful at the ceremony at Johannesburg's FNB Stadium.

"Wow, he is so compassionate, that­'s why he takes a selfie picture with the PM of England and the Dutch PM while his pee'd off wife sits there in the distance. What a shameful thing to do, Mr President," one commentator said.

Another tweeted: "No matter what party you are affiliated with, no matter what your job title is, if you a take a selfie at a funeral [sic], then you are a disrespectful, classless self-obsessed a*****e. "

A third wrote: "I wish I could say that I'm shocked that: A.) Obama took a selfie at a memorial service, or B.) he looked like a giddy tween while doing it.

The White House has not commented on the selfie.

Mandela, South Africa's first black president, died at home in Johannesburg after a long battle with a lung infection. He was 95.

His funeral is scheduled to take place on Sunday 15 December in his home village of Qunu.