WASHINGTON — Even in death, Nelson Mandela is bringing together unlikely bedfellows.

For President Obama, the trip to South Africa for the international icon’s memorial service has been a steady series of encounters that can test diplomatic protocol.

The memorial drew dozens of dignitaries and heads of state, including three former U.S. presidents, a bipartisan congressional delegation, and leaders from around the world. Each brought a tangle of tricky relationships and subtext that had to be, at least publicly, set aside to honor a man who championed the art of reconciliation.

Among those world leaders was Cuban President Raul Castro, who was seated in the same VIP section as Obama at the memorial service Tuesday at a soccer stadium in the Johannesburg township of Soweto. Obama shook the Cuban leader’s hand as he greeted his fellow heads of state, generating a photo that immediately ricocheted around the Internet.

It was the first such contact between a U.S. and Cuban president in 13 years, a White House official said. Cuban President Fidel Castro approached President Bill Clinton to shake his hand at a United Nations meeting in 2000.

Like officials did then, the Obama administration did not assign extra meaning to the face-to-face encounter Tuesday, although it comes as Obama is planning to revisit U.S. policies toward Cuba.

The president was solely focused on honoring Mandela, said a White House official, who asked not to be named discussing the president’s private interactions.

“We appreciate that people from all over the world are participating in this ceremony,” the official said. “As the president said, we urge leaders to honor Mandela’s struggle for freedom by upholding the basic human rights of their people.”

More recent diplomatic tension also swirled around Obama at the high-powered gathering. After delivering his remarks, Obama was followed at the podium by Brazilian President Dilma Rousseff, who recently postponed a trip to Washington over reports that the U.S. had spied on Brazilian leaders. Obama had tried to smooth over trouble with Rousseff at a meeting of world leaders in Russia in September, without success.

The history-making memorial service was a hot ticket for U.S. lawmakers and a chance for the White House to do a little congressional outreach. The delegation of lawmakers that traveled to South Africa included several members of the Congressional Black Caucus, as well as Illinois Republican Rep. Aaron Schock and Texas Republican Sen. Ted Cruz, the latter among Obama’s toughest critics in the Senate.

“It’s a unique experience, obviously,” said National Security Council spokesman Ben Rhodes.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.