HAVANA - It was the briefest of moments, just seconds, two presidents shaking hands and exchanging pleasantries amid a gaggle of world leaders together to honor the late Nelson Mandela.

It would hardly have been noteworthy, except the men locking hands in Johannesburg were Barack Obama and Raul Castro, whose nations have been mired in Cold War antagonism for more than five decades.

A single, cordial gesture is unlikely to wash away bad blood dating back to the Eisenhower administration.

But in a year that has seen both sides take small steps at improving the relationship, the handshake stoked talk of further rapprochement.

"On the one hand you shouldn't make too much of this. Relations between Cuba and the United States are not changing tomorrow because they shook hands," said Geoff Thale, a Cuba analyst at the Washington Office on Latin America, a U.S.-based think tank.

He contrasted the moment to a 2002 development summit where then-Mexican President Vicente Fox asked Fidel Castro to leave to avoid having him in the same room as President George W. Bush.

"What's really striking here is the contrast," Thale said. "It's a modestly hopeful sign, and it builds on the small steps that they're taking."

Not everyone was so happy about it.

"Sometimes a handshake is just a handshake," said Ileana Ros-Lehtinen, a Cuban American congresswoman from Florida who until January was chair of the House Committee on Foreign Affairs. "But when the leader of the free world shakes the bloody hand of a ruthless dictator like Raul Castro, it becomes a propaganda coup for the tyrant."

Obama and Castro's encounter is the first of its kind between sitting U.S. and Cuban presidents since Bill Clinton and Fidel Castro shook hands at the United Nations in 2000.

It came as Obama greeted a line of world leaders on his way to the podium for a speech at the memorial.

Obama also had a cheek-kiss for Brazilian President Dilma Rousseff. The two have clashed over reports that the National Security Agency monitored her communications, leading the Brazilian leader to shelve a state trip to the United States earlier this year.