Charleston bills itself as “America’s most historic city,” and the tragic massacre that took place yesterday at Charleston’s Emanuel African Methodist Episcopal (AME) Church is merely the latest episode in a long saga of violence waged against that particular congregation and its leadership. Although the motives of alleged shooter Dylann Roof are only beginning to emerge, the initial details suggest that yesterday’s events are part of a story that began in 1817, when the church was first founded.

From its founding until 1855, South Carolina was home to a black majority. As a result, its slave code was the most draconian on the English mainland. City officials monitored every aspect and moment of the lives of blacks in their community, and white ministers played their part. Many owned enslaved domestics, and one assured his mixed-race congregation that the Bible pronounced it “contrary to God’s will to run away or to harbor a runaway.” Not surprisingly, black men like carpenter Denmark Vesey, who had purchased his freedom in 1799 with lottery winnings, felt spiritually alienated in Charleston’s white-dominated churches.

In early 1817, white Methodist churchmen, in a calculated act of cultural domination, announced plans to build a hearse shed—a garage—atop a black cemetery. In protest, 4,376 blacks quit Methodism and formed the first Emanuel AME Congregation not far from the current location, with Vesey often acting as a lay preacher. The church quickly became the focal point for the city’s enslaved community, and, because of this, was routinely harassed by city officials. State and city ordinances allowed for black worship, but only between sunrise and sunset, and demanded that a majority of the congregants be white. The church’s ministers allowed Vesey to teach reading and writing, which violated of the state’s ban on black literacy, leading Charleston authorities to repeatedly shut the church down. One Sunday in June 1818, whites swept into the church, arresting 140 “free Negroes and Slaves.” Eight churchmen were fined and sentenced to receive ten lashes. Authorities invaded the church again in 1820, and in 1821 the city council warned Reverend Morris Brown that they would not tolerate “a school for slaves.”

This desecration of sacred ground—a capital offense in the Old Testament—led some slaves to advocate rebellion. Charleston’s slave population was never content with their condition, but blacks understood the odds against a successful revolt. Enslaved wives needed a live husband, not a dead martyr. But the continual war against the Emanuel AME Church, created a sense of desperation.

In 1822, 55-year old Vesey organized a plan to rise up with a small band of lieutenants on July 14, Bastille Day. But as whispers of his revolt leaked out, Vesey moved his plans forward to June 16. As church bells across the city tolled midnight, bondmen were to slay their masters and fight their way to the docks. Most of the bloodshed would have taken place on June 17—193 years to the day of the recent tragedy. (While we know little about the alleged shooter, early reports indicate that the alleged shooter is a white supremacist—most likely one who knows his history.) The planned violence in 1822 was not an end in itself, but a means to an end: black liberation and freedom in Haiti. Vesey was a tough, hard man who had survived a childhood in St. Thomas and Haiti. Some of his children yet belonged to other men. So he conspired, as he once mused, “to see what he could do for his fellow creatures.”

As was so often the case, a handful of nervous bondmen informed their masters of what was afoot. Vesey and 34 others were hanged from the city gallows, and another 35, including his son Sandy Vesey, were resold to Spanish Cuba. The mayor believed Emanuel’s two ministers, Morris Brown and Charles Drayton, to be innocent of the plot, but their church was too dangerous to exist. The two ministers were banished to Philadelphia, and the building was razed to the ground.

With the Civil War’s end, the church was rebuilt on its present location. The architect was Robert Vesey, son of the hanged abolitionist. But Emanuel’s combination of spiritual autonomy and political activism proved too much for white reactionaries. The Reverend Benjamin Randolph, a former army chaplain who took part in the 1865 rededication ceremony, was assassinated three years later while boarding a train. Like the Reverend Clementa Pinckney, who was also a state senator, Randolph, had won a seat in the state assembly. When, in 1963, civil rights activists staged a peaceful protest march out of the church, city authorities dubbed it “a negro riot” and called in 125 state troopers to support the all-white police force.

Charleston’s Emanuel congregation is arguably one of the most important churches in the South, perhaps explaining why it was targeted by a white terrorist. Sentenced to hang, Vesey quietly informed his judges that “the work of insurrection would go on.” The struggle for justice will continue, but first the entire nation needs to pause, to mourn this tragedy, and to understand its long history.