The deadly attack Wednesday night at a house of worship in Charleston, South Carolina, was an assault on all Americans as well as on a bedrock principle of American liberty — the right to worship freely.

Regardless of the motives of alleged shooter Dylann Roof — whether he had a hatred for black people (as witnesses said he proclaimed just before the crime) or for religious people, was acting out orders from some larger terrorist organization or acted as a result of an untreated mental illness — this mass murder should prompt a recommitment to protect houses of worship as sanctuaries and religious expression in general.

It also should recommit the nation to overcoming the irrational scourge of racial hatred, something Americans never seem able to move beyond no matter how much progress is apparent.

The two are, of course, related, as they have been through history.

The Emanuel AME Church in Charleston has a storied and troubled history. Organized in 1816, when slavery still was a government-sanctioned everyday reality, it was burned to the ground in 1822 by white landowners upset about a slave revolt and unwilling to grant black people the freedom even to petition their God.

Its members through the centuries have exemplified the power of committed and converted discipleship, having survived oppression, government sanction, earthquakes and prejudice to become what CNN identifies as the largest African-American church in modern Charleston. They demonstrate the indefatigable will of believers, helping all to see why the Founding Fathers wisely made religious freedom the first freedom enumerated in the Bill of Rights.

Even if the murderer had racial hatred as his primary motive, his choice to attack a sanctuary of worship puts this crime in a similar category to attacks on worshippers — often coincidentally identified by race — worldwide. It is not far removed from an arsonist’s attack this week on the Roman Catholic Church at Tabgha, in Israel, which is considered by many to be the site where Jesus performed the miracle of the loaves and fishes.

It is the hate-filled cousin of attacks throughout Egypt against Coptic Christians and their houses of worship and of terrorist attacks worldwide against ethnic believers, including by ISIS, the Taliban and other organized groups.

And it is, of course, the ugly relative of racial hate crimes that have plagued this nation, and the world, for centuries.

The U.S. Constitution guarantees the freedom to associate and to worship freely. Those freedoms are not to be confined to a house of worship, nor is religious expression to be banned from the public square.

It’s time for Americans to reawaken to the dangers of a rising secularism that would limit religious expression — recognizing, as the murderer in Charleston may have in his twisted mind, that worship is historically and inextricably linked to struggles for racial equality in this country, just as it is linked to other causes that would ennoble the human race.

We have no doubt that congregants at the Emanuel AME Church will be undeterred by this ghastly expression of hate. We hope all Americans will rally behind them and their rights, which were so brutally assaulted.