U.S. Attorney for the Eastern District of Pennsylvania William McSwain needs a history lesson.

On Wednesday, McSwain was the keynote speaker at the Union League’s annual celebration of Lincoln Day, where he preached blind devotion to the rule of law.

In his address, McSwain said that the spirit of Southern slaveholding secessionists “lives in the hearts and minds of those who declare Philadelphia a ‘sanctuary city.’” His reasoning is as ahistoric as it is offensive: Slaveholders “defied federal authorities” when they seceded from the Union, and that is just like Philadelphia not cooperating with federal immigration forces. McSwain went on to say that sanctuary cities — a movement to protect brown and black immigrants — would have “thrilled Southern slaveowners” — a group that did not recognize the humanity of people of color.

McSwain then made a bizarre leap when he claimed that sanctuary cities would have elated “those who told Rosa Parks to go to the back of the bus.” So, let’s see: In a speech about the need for blind obedience to whatever the law says, McSwain celebrated an activist who broke a law that she found unjust. When Parks refused to sit in the back of the bus on Dec. 1, 1955, she broke the Alabama state law. She was arrested and convicted of refusing to obey the orders of a bus driver. Parks’ protest challenged racist Jim Crow laws.

Perhaps McSwain applauds Parks because he doesn’t care about any laws but federal law. But his obsession with District Attorney Larry Krasner suggests otherwise. Krasner stopped prosecuting certain state offenses, like possession of an addiction treatment drug. McSwain said that Krasner “willfully — even gleefully — ignores entire sections of the criminal code.” Had there been a prosecutor in 1955 Montgomery, Ala., who refused to charge Parks for her protest, we can only assume that McSwain would have been livid in the name of the rule of law.

To bolster his argument that Philadelphia is basically on the edge of secession, McSwain mentioned the city’s support for supervised injection sites. He said that “it should be self-evident” it is illegal. He forgot to mention that in October, a federal judge ruled the opposite.

» READ MORE: Judge: Philly supervised injection site proposal does not violate federal law

» READ MORE: Philly DA Larry Krasner will no longer prosecute people for possession of an addiction treatment drug

Slavery was the law of the land. Jim Crow was the law of the land. Separate but equal was the law of the land. What is legal is not always what is right. Laws change, often thanks to brave women and men who are willing to act courageously with the risk of legal sanctions.

The rule of law matters and should be respected — from the streets of Philadelphia to City Hall, and all the way to the White House. But “rule of law” doesn’t mean “permanent law.”

The anti-corruption efforts of McSwain’s office — including charges against two sitting members of City Council — are examples of federal law enforcement actions that make our city stronger. But when McSwain, an unelected official, wedges himself into every political discussion in our city, he seems driven more by politics than policy. That’s a shame because it erodes trust in the rule of law that he holds so dear.