The black St. Peter’s Prep student who purportedly received racist text messages warning him to drop out of the Jersey City high school's student government election sent the texts to himself, a school official confirmed last week.

“The entire Saint Peter's Prep community is relieved that this extremely distressing incident has found closure, and we commend the various law enforcement officials for their diligent work on this case over the past months,” said school spokesman James Horan, who confirmed the result of the probe after its disclosure by a police source.

The 16-year-old was running for president for the Student Council in May when he supposedly received four hateful text messages. He brought them to the attention of school officials who called in his father and police.

"We have NEVER and will NEVER have an (n-word) to lead our school," was one of the messages supposedly sent to the 16-year-old student, who at the time, was a resident in Jersey City.

The message went on to call President Obama by his middle name Hussein and used a racial slur in referring to Obama, a police report said. "We will never make that mistake again. Drop out right now . . ." it continued, a police report said.

A second message read "Whites! Your a waste on this earth, a waste at this school, and most importantly a Waste for this campaign." That message called the student government candidate a "slave" and used a racial slur, a report said.

The third message texted to -- and as it turns out from -- the student, contained a warning to drop out of the race and the fourth read, in part, "COMEONE your black!!! lol your a joke for even trying to run," according to a police report.

The 16-year-old eventually lost the race for student council president but was elected vice president. A source said he no longer attends the school.

Police were not immediately able to determine who sent the text messages because they were sent using a phone app called TEXTME.

In an interview with The Jersey Journal at the time the texts were sent, the boy’s father said his son was “extremely nervous and feels threatened” and did not want to be interviewed.

"He is the type of boy who does not want any kind of trouble," the father said. "It's so sad. He doesn't want the image of the school to be tainted."

"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,” the father said at the time.

Neither the father nor son could be reached for comment. No one answered at the family's Armstrong Avenue house on Friday.

Jersey City police spokesman Bob McHugh refused to comment on the investigation on the grounds the student is a juvenile.