President Obama on Tuesday was caught taking a “seflie” during the memorial service for Nelson Mandela in Johannesburg, South Africa.

Obama, British Prime Minister David Cameron and Danish Prime Minister Helle Thorning-Schmidt were caught snapping the picture during the event. The three are seen smiling for the photo, while first lady Michelle Obama — seated next to the president — looks away.

Selfie, which refers to a self-portrait taken with personal smartphone or webcam, was named the Oxford Dictionary 2013 word of the year.

The photo of the three world leaders went viral on social media, with critics saying the picture was inappropriate during the service to honor the departed anti-apartheid activist. Mandela died Thursday at the age of 95.

Mandela’s death sparked an outpouring of grief in South Africa for the nation’s first black president, who ended decades of minority white rule and moved the country to a multiracial democracy.

Obama spoke at Tuesday's event, joined by a host of world leaders. In his remarks, Obama called Mandela a “giant of history who moved a nation toward justice, and in the process moved billions around the world.”

Also in attendance at the service were former Presidents George W. Bush, Bill Clinton and Jimmy Carter.

Obama is scheduled to fly back to Washington later today.