BERKELEY — A teenage boy could be expelled from school and face criminal charges after he confessed to posting a computer message that had racial slurs and threats to African-Americans, officials said.

The racist post, created to look like a school web page, made references to the Ku Klux Klan and lynchings, used a slur to describe African-Americans, and included the phrase, “public lynching December 9th 2015.”

The post, which police and school officials consider a hate crime, was discovered Wednesday on a school library computer.

The Berkeley High School sophomore confessed to posting the message after school administrators interviewed him on Thursday.

Principal Sam Pasarow now will consider a range of disciplinary options for the student, including expulsion, Berkeley Unified spokesman Mark Coplan said.

“We’re reviewing the case to determine what level of discipline is possible,” Coplan said.

Berkeley police are working with the District Attorney’s Office to decide on the teenager’s charges, which could be filed as soon as Friday afternoon, Officer Byron White said.

“There are several different forms of threats,” he said, “And we’re trying to get a sense of where along the spectrum this might land.”

The student, 15, is not in custody and was released to his family, White said. He will not be identified because he is a minor, per standard police procedure, authorities said.

The teenager’s race also will not be revealed because doing so would violate California education law involving the discipline of students, Coplan said.

“We’ll never hear about (the student’s race), that’s the nature of the state education code,” Coplan said. “From this point on, everything will be done to protect that student’s identity.”

The racist message infuriated the school community, leading more than 1,500 students and employees to walk out of classes and march from the high school to UC Berkeley, holding several anti-racism rallies on both campuses Thursday.

Students there chanted and waved signs that read, “Black is beautiful,” “Stand up!” and “Black Lives Matter.”

Pasarow and Berkeley Unified Superintendent Donald Evans took part in demonstrations throughout the day, which included a march through downtown Berkeley streets as officers controlled traffic.

Police praised the students for being peaceful and well-organized during their demonstrations. “Those are the kinds of marches we like to see,” White said.

The high school campus was much calmer on Friday, as classes were closed for a long-planned teacher’s work day, Coplan said.

However, school district leaders say they want to use the ugly incident as “a teachable moment” to help students explore the issues of bias and race.

Pasarow intends to designate Dec. 9 — the date referenced in the computer message — as a day set aside for African-American students, Coplan said.

“He wants to give that day back to students, making it a day to feel empowered over a hateful situation, instead of feeling threatened or helpless about it,” he said.

Staff writer George Kelly contributed to this report. Contact Chris De Benedett at 925-482-7958. Follow him at Twitter.com/cdebenedetti.