LITTLE ROCK, Ark. (AP) - A federal judge has granted a school district's request to bar a 15-year-old student from campus after allegations he posted a photo to SnapChat holding a gun.

U.S. District Judge Kristine Baker ruled in favor of the Vilonia School District, citing "significant interest in maintaining school safety."

The district filed a lawsuit against the teen's parents after suspending the student, who receives special-education services.

Court records state the student posted a photo on March 1 to Snapchat with his finger on the gun's trigger and the hashtag “#ILOVEITWHENTHEYRUN”, which is a song by rapper XXXTentacion.

Later, court records show school officials found a photo he took with a belt around his neck and a video of the teen with a gun saying "I don’t fight to hurt, I fight to kill."

The student was suspended from school on March 6 but, because of his special needs, the school could not extend the suspension for a significant period of time. So the district requested a temporary restraining order.

His parents are arguing this violates the Individuals with Disabilities Education Act that requires public schools to accommodate special needs students.

Court documents show the student suffers from multiple disorders, including traumatic brain injury, depression and oppositional defiant disorder.