The messages sent to the student in May used racial slurs, called him a slave and warned him to drop out of the race, reports NJ.com. The boy brought the messages to the attention of St. Peter's Prep officials, who notified his father and police.
The texts couldn't immediately be traced to a sender because they were sent via a phone app called TEXTME. Police eventually tracked the messages back to the student who received them, according to NJ.com.
The student who allegedly sent the messages to himself lost the election for class president, but was elected vice president.
At the time the texts were sent, the boy's father told NJ.com., "It is a predominantly white school and there may be a few sections of the school who are fearful of a new face trying to get in office."
NJ.com reports he no longer attends St. Peter's Prep and neither he nor his father could be reached for comment.
After learning the boy had sent the texts to himself, a school spokesman told NJ.com, "The entire Saint Peter's Prep community is relieved this this extremely distressing incident has found closure."