A 24-year-old activist and former Kean University student has been charged with tweeting threats to black students, faculty and staff at the New Jersey school two weeks ago, prosecutors said.

Authorities said Kayla-Simone McKelvey posted the threats using a campus computer the night she attended a rally protesting racial intolerance on college campuses.

"We are saddened to learn that the person allegedly responsible was an active participant in the rally," Kean University President Dawood Farahi said.

Several anonymous messages posted to Twitter during the Nov. 17 rally threatened to "shoot every black woman and male" at the college.

McKelvey, a self-proclaimed activist and the president of the Pan-African Student Union, left the rally about midway through, Union County Prosecutor Grace Park said.

Authorities believe she went to a computer station located in the university library and created an anonymous Twitter account, which she used to post the racially charged threats of violence against black students and staff at Kean.

McKelvey then went back to the rally and drew attention to the threats that she had posted, according to prosecutors.

The threats led to additional police security, and the Department of Homeland Security was notified, as were state, county and local authorities.

On Nov. 18, the university's police department said in a Facebook post the campus would remain open despite the threats.

"We are profoundly troubled by this display of hatred which does not reflect in any way the values we hold sacred on our diverse campus," police wrote in the post.

Although the Twitter account was shut down the following morning, many students at the university said they feared for their safety. Some even stayed in their rooms, according to one student.

Black students make up about 25 percent of the student body at Kean, which says it prides itself on diversity.

Police said an investigation has led to the conclusion there was never a plan to harm students and that no one was in danger.

McKelvey has been charged with a single count of creating a false public alarm.

According to The Tower, a Kean University student newspaper, McKelvey is the president of the Pan-African Student Union. The newspaper said McKelvey was outspoken during a demonstration in March 2015 protesting the alleged racist comments of a Kean professor.

McKelvey said that the professor made racist comments about Tamir Rice, a 12-year-old boy shot and killed by a Cleveland police officer in November 2014. The professor allegedly said that Rice deserved to die.

McKelvey is scheduled to appear in court on Dec. 14 at the Union County Jail.