Democratic presidential candidate Hillary Clinton directly confronted issues of race and hate in a speech Saturday following the Charleston shootings. (Stephen Lam/Reuters)

The massacre last week at a church in Charleston, S.C., opened a leadership opportunity for the nearly two dozen politicians running to be the next president.

But few stepped forward to seize it.

The Republican hopefuls mostly stammered and stumbled in response to the shootings. At first, some resisted calling the massacre racially motivated, only to reverse course when it became obvious it was.

Most stopped short of calling for South Carolina leaders to remove the Confederate battle flag from the grounds of the state capitol in Columbia. Some, like Wisconsin Gov. Scott Walker, declined to comment at all. Only after South Carolina’s Republican governor, Nikki Haley, emotionally declared Monday that the flag should come down did most GOP candidates join the chorus.

Some also lacked sensitivity. Sen. Ted Cruz joked Friday — less than two days after the slayings — that in his home state of Texas, gun control means “hitting what you aim at.” The next day, he campaigned at a shooting range.

Democratic front-runner Hillary Rodham Clinton, by contrast, has forcefully initiated a conversation about race and bigotry in recent days. At this moment of national trauma, the Republican candidates seemed as though they didn’t know what to say.

“This is a leadership opportunity for candidates to show the kind of moral clarity and risk-taking leadership it will take to lead the free world,” said Russell D. Moore, president of the Ethics and Religious Liberty Commission of the Southern Baptist Convention. “I think that candidates who are skittish are demonstrating that they’re not aware of where the country is right now.”

Clinton gave an impassioned speech about persistent racism to the U.S. Conference of Mayors on Saturday.

“It’s tempting to dismiss a tragedy like this as an isolated incident, to believe that in today’s America bigotry is largely behind us,” Clinton said. “But despite our best efforts and our highest hopes, America’s long struggle with race is far from finished.”

Clinton plans to discuss the Charleston shootings Tuesday afternoon during a community meeting at a predominantly black church in Florissant, Mo., near Ferguson, site of last summer’s searing race riots. In praising ­Haley’s decision in a tweet Monday, Clinton noted that she had opposed the Confederate flag “for years.”

Mitt Romney called for the Confederate flag to be removed from the grounds of the South Carolina state capitol. Here's what top Republican presidential hopefuls have had to say on the matter. (Gillian Brockell/The Washington Post)

She is not alone in the Democratic field. Sen. Bernie Sanders (I-Vt.), who is seeking the Democratic nomination, voiced outrage after the shootings and said Monday that the Confederate flag should be removed because it had become “a relic of our nation’s stained racial history.” Former Maryland governor Martin O’Malley advocated tougher gun laws and said Sunday that the Confederate flag flying in Columbia was “a terribly jarring and callous sight.”

David Axelrod, a longtime adviser to President Obama, said, “Presidential races are full of these unexpected moral tests and tests of mettle. It’s generally the person who rises to them who ends up winning the day.”

For Republicans especially, rising to the occasion has proved difficult. The candidates have been balancing the political imperative to present a welcoming face to minority and moderate voters with hesi­tancy to turn off conservative white voters who see the Confederate flag as a representation of their family heritage and Southern traditions.

The result has been timid, measured responses. It is telling that the most unambiguous Republican statement came from a non-candidate; 2012 GOP nominee Mitt Romney tweeted Sunday, “Take down the #ConfederateFlag at the SC Capitol.”

Stuart Stevens, Romney’s former chief strategist, said, “Racism is the great American tragedy and conundrum, and it is always difficult to discuss. In a campaign environment, it’s always more difficult. Both Hillary Clinton and ­Barack Obama struggled to address it in 2008. There’s no magic wand that’s made it easier in 2015 or 2016.”

Walker acknowledged Saturday night that the shooting was committed by “a racist and evil man” but withheld an opinion on the Confederate flag. After Haley’s statement on Monday, Walker tweeted that he supported her decision. His aides insisted that he had arrived at his position days earlier but declined to weigh in because he did not want to distract from the period of mourning.

Former Florida governor Jeb Bush initially said Friday that he wasn’t sure whether accused Charleston shooter Dylann Roof was a racist. Bush later clarified that he believed the shooting was racially motivated.

As governor in 2001, Bush ordered the Confederate flag on his state’s capitol grounds to be put in a museum. Over the weekend, he said he believed South Carolina’s leaders would “do the right thing,” although he did not explicitly state an opinion.

Moore said few candidates have shown the moral leadership voters want. “Coming after a year in which we’ve had one moment of racial violence after another, we need clear leadership from the candidates about how we unite as a country on these issues of racial reconciliation and justice,” he said.

Despite the election of the first black president, Clinton said Saturday, economic inequality persists, along with subtle and often unacknowledged biases.

“Our problem is not all kooks and Klansmen,” she said. “Let’s be honest, for a lot of well-meaning, open-minded white people, the sight of a young black man in a hoodie still evokes a twinge of fear.”

In a Gallup poll in May, respondents gave Clinton higher marks for her leadership on race issues than on any other topic.

Clinton also is viewed as stronger on race relations than Obama. A Pew Research Center poll in December found that 44 percent thought she would do a “good job” on the issue, while 40 percent approved of Obama’s handling of race relations and 50 percent disapproved.

Clinton’s allies said that her focus on race relations was in keeping with her life’s journey. She grew up during the 1960s civil rights movement and has said that going to see the Rev. Martin Luther King Jr. speak in Chicago as a teenager was a formative moment.

“This is something that comes naturally to her,” Axelrod said. “I don’t think this is the contrivance of the campaign. But it’s also true that the Democratic Party is a very diverse party, and her allegiance to the minority components of the coalition is one of the reasons why she’s going to be very, very hard to beat for the nomination.”

Clinton has had her own stumbles discussing race issues, however. In the 2008 race, she ran into trouble over remarks on civil rights and King’s legacy that some blacks saw as insensitive. Obama at the time called them “unfortunate” and “ill-advised.”

Clinton supporters say she is doing exactly what she should do after a tragedy.

Don Fowler, a South Carolina-based Clinton ally and former Democratic National Committee chairman, said that many of the Republican candidates do not have “the emotional and psychological background” to confidently talk about race relations.

“If you have the right kind of heart and soul, a proper reaction comes out,” Fowler said. He added, “To react to something like this, you have to feel it. You have to understand it. Without having experienced in any way the context of this, the dynamics of it, it’s hard for them to react to it in a courageous and compassionate way.”