WASHINGTON — When it comes to states’ rights, President Donald Trump is all over the map.

To battle the coronavirus, he’s told states they’re largely on their own. But when it comes to stamping out protests in cities led by Democrats, Trump is sending in federal troops and agents — even when local leaders are begging him to butt out.

It’s a driven-by-expedience approach that’s been a hallmark of his stormy presidency, one that has little to do with ideology and more to do with reelection efforts.

“After seeing Trump in the White House for three and a half years, anyone expecting to find classical ideological consistency is bound to be mistaken,” said Andrew J. Polsky, a political science professor at Hunter College. “All of this is done for partisan political purposes with an eye toward the election.”

For months now as he’s tried to skirt responsibility for the nation’s flawed response to the coronavirus, Trump has put the onus on states, first to acquire protective gear and testing agents and then to scale testing and contact tracing.

“The federal government is not supposed to be out there buying vast amounts of items and then shipping. You know, we’re not a shipping clerk,” Trump said in March when testing in the U.S. severely lagged behind other countries and governors were pleading for help as they competed against one another on the open market.

Just a month later, Trump flipped to asserting vast executive authority as he pushed states to reopen their economies fast.

“When somebody is the president of the United States, the authority is total,” he declared in April, in an inaccurate interpretation of the Constitution.

He quickly reversed course, saying he’d leave reopening plans up to the states, but continued to threaten to intervene if he didn’t like what they were doing. Now, he’s pressuring schools to fully reopen in September, saying he’ll pull funding from school districts that continue to keep kids home.

That approach stands in stark contract with Trump’s view of “law and order,” the mantle under which he’s decided to run his 2020 race.