President Barack Obama unleashed a blistering and belittling rebuke of Republican White House hopefuls Monday, calling their attack on his landmark nuclear deal with Iran "ridiculous if it weren't so sad."

Standing before television cameras during a trip to Africa, Obama suggested the bellicose rhetoric from some GOP candidates was an attempt to divert attention from Donald Trump, the wealthy businessman-turned presidential contender whose popularity is confounding the Republican field.

"Maybe it gets attention, and maybe this is just an effort to push Mr. Trump out of the headlines, but it's not the kind of leadership that is needed for America right now," Obama said during a news conference in Ethiopia.

Obama's comments marked his most direct engagement in the race to succeed him. Until now, he's largely limited his commentary to policy differences with Republicans, often sidestepping the names of specific candidates.

But the president's unsparing criticism Monday — targeting candidates Mike Huckabee and Ted Cruz, as well as Trump — underscored his sensitivity to efforts to scuttle the Iran accord, which he hopes will be his signature foreign policy initiative. It also raised the prospect of an aggressive role for Obama in the 2016 presidential campaign.

Huckabee references Holocaust

"In 18 months, I'm turning over the keys," Obama said. "I want to make sure I'm turning over the keys to somebody who is serious about the serious problems that the country faces and the world faces."

The president was asked specifically about Huckabee's assertion that Obama had agreed to a nuclear deal that would "take the Israelis and basically march them to the door of the oven," a reference to crematoria in Nazi concentration camps during the Holocaust. The Israeli government staunchly opposes the agreement and views an Iranian nuclear program as a threat to its existence.

I will stand with our ally Israel to prevent the terrorists in Tehran from achieving their own stated goal of another Holocaust. - Mike Huckabee

​Obama said the comments from Huckabee, a former Arkansas governor, were part of a broader pattern from Republicans. He also singled out Cruz, the Texas senator, for saying the nuclear deal makes Obama — not Iran — the leading state sponsor of terrorism.

"These are leaders in the Republican Party," Obama said, seeming incredulous. He suggested the GOP was breaking longstanding American tradition of not playing "fast and loose" with facts during serious foreign policy debates.

Hillary Rodham Clinton, the front-runner for the Democratic nomination, said she was "offended personally" by Huckabee's comments. His remarks should be "repudiated by every person of good faith," she said during a campaign stop in Iowa Monday.

Huckabee dismissed the criticism, arguing that what was "ridiculous and sad" was that Obama wasn't taking Iran's threats to destroy Israel seriously.

"I will stand with our ally Israel to prevent the terrorists in Tehran from achieving their own stated goal of another Holocaust," Huckabee said in a statement.

Congress has until mid-September to review deal

The White House is the midst of an intense lobbying campaign to prevent Congress from blocking implementation of the Iran deal. Lawmakers have until mid-September to review the accord, which aims to curb Iran's nuclear program in exchange for relief from international economic sanctions.

Obama deflected Republicans' criticism of the deal Monday, calling it 'ridiculous if it weren't so sad.' (Evan Vucci/Associated Press) The Republican candidates are united in their opposition to the deal, saying Obama has left Iran on the brink of building a bomb and done nothing to address Tehran's support for terrorism. Some, including Wisconsin Gov. Scott Walker and Florida Sen. Marco Rubio, have vowed to immediately scrap the agreement if elected.

Obama's unprompted analysis of Trump's effect on the Republican field marks a shift for the president. He's largely steered clear of opportunities to weigh in on controversial statements Trump has made in recent weeks about Mexican immigrants and the war record of Republican Sen. John McCain, of Arizona, who was taken prisoner in Vietnam.

Obama brought up on his own Trump's suggestion that McCain wasn't a war hero because he was captured. Praising McCain's heroism, the president said Trump's remarks grew out of a political culture where those types of comments are tolerated.

"When outrageous statements are made about me, a lot of people outraged about McCain were pretty quiet," he said.

Obama has a long history with Trump, who was a driver of the "birther" movement that claimed the president wasn't born in the U.S. Trump's claims pushed Obama to release a copy of his birth certificate in 2011.

For years, Trump has been a sought-after surrogate and fundraiser for GOP candidates. As a candidate himself, he's unexpectedly emerged this summer as a leading contender for the GOP nomination, tapping into voters' discontent with Washington.

While some GOP candidates stepped up their criticism of Trump after his comments on McCain, the businessman's standing with voters does not appear to have been significantly damaged. He is still expected to be among the 10 candidates who qualify for the first Republican debate on Aug. 6 based on their standing in national polls.