Dylann Roof
Police released this surveillance photo outside of the Emanuel African Methodist Episcopal Church in Charleston of a young man identified as Dylann Roof.Charleston Police Department

The gunman in the mass killing at a historic South Carolina black church who shot dead the popular pastor and eight parishioners left three people alive to tell his story, said witnesses.

Parishioners pleaded with alleged gunman Dylann Roof, 21, not to open fire in the Charleston church Wednesday night, but he said: "I have to do it. You rape our women and you're taking over our country, and you have to go," said Sylvia Johnson, a cousin of the church's slain pastor, who spoke to survivors. Seconds before the attack, authorities said Roof stood up and announced he was there to "shoot black people."

"He told one woman: 'I'm not going to kill you, I'm going to spare you, so you can tell them what happened,' " Charleston NAACP President Dot Scott told CNN, based on accounts from the woman's family.

When Roof first came to the church he asked for Clementa Pinckney, the senior pastor at Emanuel African Methodist Episcopal Church (and a state senator), then sat quietly in church next to him for an hour until the end of a Bible study group, reports NBC News. That's when he stood up, allegedly opened fire and reloaded five times.

The massacre in the historic African American church was the deadliest attack on a place of worship in the US in 24 years.

Roof, of nearby Eastover, was arrested Thursday morning at a traffic stop without incident some 250 miles from the attack.

He was reportedly identified on a surveillance video photo at the church by his uncle Charles Cowles, who said Roof's father had given the alleged gunman a .45-caliber handgun for his 21st birthday. Cowles described his nephew as "soft-spoken." He appears on his Facebook page sporting Rhodesia (now Zimbabwe) and South African apartheid flags pinned on his jacket.

The shooting victims — six women and three men — ranged in age from 26-year-old Tywanza Sanders, a recent graduate of Charleston's Allen University, to 87-year-old long-time church member Susie Jackson.

The community and nation were left reeling by the attack. "Even as we struggle to comprehend this heartbreaking event, I want everyone in Charleston and everyone affected by this tragedy that we will do everything in our power to heal this community and make it whole again," US Attorney General Loretta Lynch told reporters.