Fired FBI Director James Comey is accusing President Donald Trump of attempting to exploit racism as part of a strategy to win re-election in the wake of a pair of deadly shootings.

“Our president thinks he is doing something clever. He lifts the control rods for a calculated and deeply cynical purpose: to harness the political energy unleashed. It will heat his re-election bid, he likely thinks. But unconstrained, it will damage the nation, in all directions. Only fools believe they can ride the gamma rays of hate,” Comey wrote in a New York Times opinion-editorial.

“Every American president, knowing what lies deep within our country, bears a unique responsibility to say loudly and consistently that white supremacy is illegitimate, that encouraging a politics of racial resentment can spawn violence, and that violence aimed at people by virtue of their skin color is terrorism,” the longtime law enforcement official added.

Comey’s latest criticism comes after he appeared to weighed in last month on chants of “send her back” at President Trump’s rally in Greenville, North Carolina, urging that the president and his supporters must be sent back to their “dark corner” in the 2020 presidential election.

“We have long had ugly margins in this country, but we are a fundamentally decent people, with shared values. We treasure our identity as a nation of immigrants,” he tweeted. “With our voices and our 2020 votes, we must send Donald Trump and his mob back to their dark corner.”

Twenty people were killed Saturday in the shooting at an El Paso, Texas, Walmart, which is being investigated as a hate crime and a domestic terrorism case. Another nine were killed by a gunman Sunday in Dayton, Ohio. That shooter was killed by police.

On Monday, President Trump addressed the shootings, declaring that the United States “must condemn racism, bigotry, and white supremacy.”

“These sinister ideologies must be defeated. Hate has no place in America,” he said.

“These barbaric slaughters are an assault upon our communities, an attack upon our nation, and a crime against all of humanity,” he added. “We are outraged and sickened by this monstrous evil.”

Early Monday, President Trump suggested merging immigration reform and background check legislation.

“We cannot let those killed in El Paso, Texas and Dayton, Ohio, die in vain,” the president tweeted. “We can never forget them, and those many who came before them.

“Republicans and Democrats must come together and get strong background checks, perhaps marrying this legislation with desperately needed immigration reform. We must have something good, if not GREAT, come out of these two tragic events!” he added.

The UPI contributed to this report.