Dylann Roof, who is suspected of killing nine people at the Emanuel AME Church in Charleston, South Carolina, has been arrested.
Police said 21-year-old Dylann Roof, from Lexington, South Carolina, was detained during a traffic stop in Shelby, North Carolina.
Dylann Roof is reported to have sat in on a bible study meeting for a full hour before opening fire on the group.
Six women and three men, including the church pastor, were killed. A hate crimes investigation has been launched.
President Barack Obama said he and his wife had known several members of the Emanuel AME Church, including the pastor, Clementa Pinckney.
Barack Obama called the church a “sacred place” in the history of Charleston and spoke of his confidence that the congregation and the community would “rise again”.
He also raised the issue of gun ownership, saying “communities like this have had to endure tragedies like this too many times”.
“At some point, we as a country have to reckon with the fact that this type of massacre does not happen in other advanced countries,” the president said.
The weekly bible study meeting was under way in the church on Calhoun Street when the shooting unfolded at about 21:00 local time on Wednesday, June 17.
Charleston Police Chief Gregory Mullen said that when police arrived at the scene eight people were already dead in the church and one other person died later in hospital. There were three survivors, he added.
Police released images from surveillance cameras showing a suspect they described as white and clean shaven with a slender build, entering the building an hour before the shooting.
The man was later seen driving away in a black four-door saloon car.
Police and officials were quick to call it a hate crime, and the DoJ said it would open a federal hate crimes investigation.
Speaking after the arrest, Attorney General Loretta Lynch said they would be “looking at all of the facts, all of the motivations” to determine the best way to prosecute any case.
The killings have sent shockwaves through a community that has already experienced heightened racial tension in recent months.