Not long after the founding of the United States, the white establishment of Charleston, S.C., had much to fear. A slave revolt had swept the French colony of Saint-Dominque, now Haiti, in 1791. Charlestonians read of slaves who slaughtered whites indiscriminately, carrying as their standard “a pike with the carcass of an impaled white baby.”

Could such horrors come north?

“I am afraid if not checked in time it is a flame which will extend to all the neighbouring islands, & may eventually prove not a very pleasing or agreeable example to the Southern States,” Charles Pinckney, South Carolina’s governor, wrote to President George Washington that year. “The conflagration … the general destruction of property, & a probable famine are particularly unpleasant to us who live in Countries where Slaves abound.”

In 1793, word circulated of a plan extending from Virginia to the Carolinas reportedly involving thousands in chains rising up against their masters. “We will kill all before us,” one conspirator was said to have boasted. “It will begin in every town in one night.”

As the 19th century dawned, “Carolina residents began to fear that their human property were plotting for their freedom,” historian Douglas Egerton wrote in 1999. “Newspapers reported that urban slaves had suddenly become ‘very insolent,’ as if they believed that events would soon allow them to abandon the polite mask of subservience.”

In this clip from an unreleased documentary about African Methodism in South Carolina, Rev. Clementa Pinckney and others discuss the role of the Emanuel African Methodist Episcopal Church. (Rev. Mark Kelly Tyler)

Into this charged atmosphere came Morris Brown, a free mulatto, and Henry Drayton, a former South Carolina slave. Both were members of the Bethel Methodist Church, a majority black church in Charleston nonetheless run by whites, as was common at the time. In 1818, Brown and Drayton discovered the church’s white trustees had decided to build a hearse house on top of the black cemetery adjoining the church. In protest, more than 4,300 African American parishioners walked out and formed their own congregation, which soon associated itself with the newly-formed African Methodist Church in Philadelphia.

This was the beginning of what is now the Emanuel AME Church of Charleston — the one allegedly invaded on June 16 by Dylann Roof, who is charged with gunning down nine people gathered for Bible study and prayer. The dead included the Rev. Clementa Pinckney, most likely a descendant of slaves owned by the vast Pinckney family that included Charles Pinckney, who wrote the letter to President Washington worrying about insurrection.

President Obama will eulogize mass shooting victim Rev. Clementa Pinckney at his funeral Friday, the day after thousands turned out for his wake. (Reuters)

Just forming the church that would become Emanuel AME was, to Charleston’s whites, a form of such insurrection. For the first time in that city, blacks could worship and conduct classes on their own despite “religious assembly” laws expressly banning just that.

“The formation of the African Church in Charleston was a rebellious act of revolutionary proportions,” historian Bernard Powers wrote in “Black Charlestonians: A Social History.” “… The city authorities recognized the full import of the initiatives taken by this group of slaves and free blacks and responded with harassment.”

In June 1818, 140 members  of the church were arrested. Five ministers, including founder Brown, were given the choice of leaving South Carolina or serving a month-long jail sentence. Brown elected to do his time and stay in Charleston.

So did the church. But that wasn’t the end of its troubles.

In 1820, congregants were arrested for holding late night services — a crime. Two years later came allegations of a worse one: Members of the church led by a free black named Denmark Vesey plotted a slave insurrection. Authorities said up to 9,000 slaves were to mobilize with stockpiles of pikes and other weapons; none were ever found, and other physical evidence was thin. Indeed, a 2001 study by Johns Hopkins historian Michael P. Johnson in the William and Mary Quarterly suggested the plot may have never existed.

Still, this could not stand. Southerners saw themselves as good Christians, but when it came to teaching the word of God to slaves, they were conflicted. On one hand, they felt it was their duty; on the other, they understood the Gospels threatened their twisted moral justification for slavery — and perhaps even threatened white lives.

There was nothing resembling a trial for Vesey and the others, but rather secret interrogations and “confessions” extracted from church members threatened with hanging and tortured by whippings and an after-the-fact account of the proceedings that, Johnson has written, is filled with contradictions. Vesey and some others remained silent.

“The prospect of impending death upon the gallows typically weakened the resolve of even the most sanguine of revolutionaires,” historian Egerton wrote in “He Shall Go Out Free: The Lives of Denmark Vesey.”

Vesey and 34 others, all associated with the church, were hanged in July, 1822. Thirty-seven were transported outside the United States.

This, said the authorities, is the consequence of letting blacks worship on their own, with their own leaders. Meetings of any kind by “held solely by slaves” were dangerous. Worse: The congregation — Brown’s church, Vesey’s church — “was not only composed altogether of coloured persons, but their Ministers of the Gospel … The influence which such men and class leaders must necessarily acquire over the minds of the ignorant blacks is evident.”

Especially, as the tribunal wrote, “if a disposition exists in them to obtain for their own colour and themselves, the freedom and privileges enjoyed by the whites.”

Discovery of Vesey’s purported plot destroyed the church for decades. It razed by order of the city, but reopened with a new building after the Civil War. The building was designed by architect Robert Vesey — yes, Vesey’s son.

Whatever the extent of the Vesey insurrection, his heroism stands. He could not be broken. Nor could the church, which lives on. Today, a monument to Vesey stands in Charleston, and his memory stirs passion.

Ironically, the court’s portrayal of Vesey, intended to illustrate his capacity to execute such a vast conspiracy, has contributed to his mystique: “He was remarkable throughout his trial, for great presence and composure of mind,” the proceedings said. He exhibited “no signs of fear.”

And the identity of Emanuel AME is so intertwined with Vesey that it occurred to Egerton — if only for a moment — that maybe the killer had made the connection. The date set for Vesey’s alleged insurrection was June 16, 1822; the date of the killings in Charleston was June 17, 2015.

“When I woke up Thursday morning,” Egerton said in an interview with The Washington Post, “and my wife — who’s also a historian — said, ‘There’s been a shooting at Vesey’s church,’ the first thing that crossed my mind was the date. Maybe [the killer] knew that.”

As word of Roof’s arrest came, it seemed to him implausible.

But the words reportedly uttered by the alleged killer — “You’re taking over our country” — and his apparent fear of African Americans eerily echoed the sentiments of white Charleston in the first days and years after the seed that would grow into Emanuel AME was planted.

As the South’s great novelist William Faulkner wrote: “The past is never dead. It’s not even past.”