Morgan Roof, 18, had a knife, pepper spray and marijuana when she was searched at A.C. Flora High School in Columbia, South Carolina, on Wednesday, said Richland County Sheriff's Department Lieutenant Curtis Wilson.
Roof was charged with simple possession of marijuana and two counts of carrying weapons on school grounds.
Wilson said in a statement that school administrators had acted appropriately by calling the school resource officer to arrest Roof for violating school policy.
"No students were harmed as a result of this incident," Wilson said.
The arrest came on the morning of a walkout by tens of thousands of students nationwide to demand stronger gun laws following last month's Florida school shooting, in which 14 students and three faculty were killed.
Morgan Roof also made a racially charged Snapchat post about the walkout, according to the Post and Courier newspaper.
"I hope it's a trap and y'all get shot we know it's fixing to be nothing but black people walkin' out anyway," the post said, according to the newspaper.
Wilson said the post "caused alarm to the student body," but he could not immediately confirm its contents.
After being made aware of the social media post, school administrators searched Roof and found the drugs and weapons, Wilson said.
No students were in any danger, Wilson said in a statement.
Morgan Roof was released from jail on Thursday on an undisclosed bond, Richland County spokesman Andrew Haworth said.
In response to the arrests, South Carolina Governor Henry McMaster called for more security at schools.
"For months, I have called on the General Assembly to join me in placing a trained, certified police officer in every school," he said in a statement.
Dylann Roof sat for 40 minutes with parishioners at the landmark Emanuel African Methodist Episcopal Church in Charleston for a Bible study meeting before opening fire on June 17, 2015. He killed nine African-Americans in a hate-fuelled attack he had been planning for months.
He was sentenced to death after his conviction on 33 federal counts, including hate crimes and obstruction of religion. He was also sentenced under a separate state murder charge to nine consecutive life terms without parole and three consecutive 30-year prison terms for attempted murder.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)