Sen. Patrick LeahyPatrick Joseph LeahyCongress should build on the momentum from spending bill Overnight Tech: Zuckerberg grilled by lawmakers over data scandal | What we learned from marathon hearing | Facebook hit with class action lawsuit | Twitter endorses political ad disclosure bill | Uber buys bike share Overnight Cybersecurity: Zuckerberg faces grilling in marathon hearing | What we learned from Facebook chief | Dems press Ryan to help get Russia hacking records | Top Trump security adviser resigning MORE (D-Vt.) on Tuesday blasted critics of President Obama's handshake with Cuban President Raul Castro.

"How petty and off-key to attack a president for a handshake, and in such a setting," Leahy tweeted. "Can imagine what Nelson Mandela would say."

Republican lawmakers have been heavily critical of the gesture, with Rep. Ileana Ros-Lehtinen calling it "nauseating and disheartening."

The Florida lawmaker said Castro "represents one of the world’s most repressive dictatorships."

"It’s unfortunate that Cuban opposition leaders, who routinely risk their health and well-being in pursuit of their basic human rights, may be discouraged by the president acknowledging their oppressor," she said. "What would be more troubling is any softening in policy toward the communist Castro regime that regularly denies its citizens their liberty and basic freedoms."

Sen. John McCain (R-Ariz.) compared the handshake to the one between Neville Chamberlain and Adolph Hitler — although later said the comparison was made "in jest."

"Yeah, it was a joke. But it does give Raul Castro, who is a total dictator, prisons filled with dissidents, a propaganda boost. It does," McCain said.

Sen. Marco Rubio (R-Fla.) also blasted the handshake.

“If the president was going to shake his hand, he should have asked him about those basic freedoms Mandela was associated with that are denied in Cuba,” Rubio said.

Secretary of State John Kerry and other Obama administration officials insisted that the handshake at Mandela's memorial was offered only in the spirit of Mandela, who famously embraced his jailer as part of South Africa’s post-apartheid reconciliation process.

“Today is about honoring Nelson Mandela,” Kerry said, noting that Obama did not choose the guests at the memorial service.

An administration official echoed that sentiment, saying that the president’s “singular focus” at the memorial service was “honoring Nelson Mandela.”

The administration official also noted that Obama, in his remarks, urged world leaders to honor Mandela's struggle for freedom by upholding basic human rights within their own country.

“There are too many leaders who claim solidarity with Madiba's struggle for freedom but do not tolerate dissent from their own people,” Obama said. “And there are too many of us on the sidelines, comfortable in complacency or cynicism when our voices must be heard.”