The officials spoke on condition of anonymity because they were not authorized to speak publicly about the investigation.

The death penalty could be a factor in deciding who prosecutes; Mr. Roof faces possible execution under South Carolina law, and Gov. Nikki R. Haley has called for the death penalty. But the federal hate crime law carries a maximum penalty of life in prison.

Federal and state prosecutors could both bring charges, and in such instances, they typically coordinate so one case does not undermine the other. Officials said no decision had been made on the timing of charges because many details remained unresolved.

Emily Pierce, a Justice Department spokeswoman, said the federal investigation was continuing.

Mr. Roof has been assigned state and federal public defenders. In his sole court appearance since the shooting, in Charleston on Monday, bond was set at $1 million, which he has not posted.

“I am not in the position to, alone, go into the ghetto and fight,” read part of the 2,500-word online screed attributed to Mr. Roof. “I chose Charleston because it is most historic city in my state, and at one time had the highest ratio of blacks to Whites in the country. We have no skinheads, no real KKK, no one doing anything but talking on the Internet. Well someone has to have the bravery to take it to the real world, and I guess that has to be me.”