Tension between the federal government and its states has permeated American history from the earliest moments of the nation’s founding 241 years ago.

Drafting the U.S. Constitution was an exercise in balancing federal authority against “states’ rights.” The Constitution’s “supremacy clause” defined federal authority, for instance, while its 10th amendment guaranteed that states could exercise powers not reserved to the national government.

The broad wording of both merely set the stage for centuries of political and judicial conflict over their meaning, punctuated by the nation’s bloodiest war.

Over those decades, “states’ rights” evolved, in the minds of many, into code words for discrimination and/or repression. It was cited, for example, by Alabama Gov. George Wallace and other defenders of racial segregation a half-century ago.

More recently, we have seen conflicts over whether the federal government or its courts could prohibit states from outlawing abortion or same-sex marriage, and over the constitutionality of state and local gun control laws.

As those instances suggest, those on the political left have usually cheered when federal law triumphed – when, for instance, state laws to crack down on illegal immigration were deemed to violate the federal government’s authority over immigration matters.

Today, however, with Donald Trump in the White House and Republicans in control of Congress, the worm has turned and California, ever the contrarian, is invoking the doctrine of states’ rights to resist the Trump administration’s vow to round up and deport those in the country illegally.

The state is home to at least two million undocumented immigrants and has done everything in its power to legalize them, such as issuing driver’s licenses.

Last month, U.S. Attorney General Jeff Sessions declared that local governments that refuse to cooperate with federal immigration authorities would lose federal law enforcement grants, citing a specific federal law barring non-cooperation.

“So-called ‘sanctuary’ policies make all of us less safe because they intentionally undermine our laws and protect illegal aliens who have committed crimes,” Sessions said.

The money involved for California is chickenfeed, just $28 million a year. However, last week, California Attorney General Xavier Becerra responded with a lawsuit, branding Sessions’ action, and the presidential order that preceded it, as an unconstitutional incursion on states’ rights.

“The Trump administration is starting with the very misguided premise (that) immigrants are a danger to the public or our public safety. That could be no further from the truth,” Becerra said at a press conference. “It’s our right and it’s our duty to fight to protect our law enforcement officers … and to protect the resources that they rely upon. “We’re in the public safety business. We’re not in the deportation business.”

As that legal conflict – one seemingly destined for the U.S. Supreme Court – begins to play out, California lawmakers and Gov. Jerry Brown may be inviting more legal war by making the entire state a sanctuary.

When the Legislature returns to Sacramento this week for the final throes of its 2017 session, a major agenda item is Senate Bill 54, carried by Senate President Pro Tem Kevin de León. It would prohibit local and state law enforcement agencies from cooperating with federal immigration authorities in identifying and holding those in the country illegally, except when it involves those convicted of particularly violent or heinous felonies.

De León says it “will prevent state and local law enforcement agencies from acting as agents of immigration and customs enforcement (and) keep them focused on community policing, rather than rounding up hardworking, honest immigrants who in many instances assist police in solving crimes rather than committing them.”

Many local law enforcement officials oppose the measure, saying it would inhibit anti-crime efforts, and Brown has not yet endorsed it. Earlier, as attorney general, Brown was leery about sanctuary laws, but has since joined other Democratic politicians in the “resistance” to Trump.

Should it be enacted, which is highly likely, it will open a new and ironic chapter to the tortured history of states’ rights.