PORTERVILLE, Calif. (KSEE/KGPE)- A teenager has been arrested after officers say he brought a firearm to school, according to Porterville Police Department officials.

Police say on Wednesday, an off-duty School Resource Officer was alerted about a teen who reportedly brought a firearm to school that day.

After reviewing a Snapchat post, which showed a picture of a male holding a handgun, the officer said they were able to confirm that it was taken in a classroom at the high school.

Upon investigating, officers determined that an 18-year-old student of the high school created the Snapchat post. Officers arrived at his home and though the student denied owning the firearm, he eventually admitted that he held the firearm and took the photo “to look cool”, according to police.

Further investigation revealed that another 17-year-old student brought the gun to school. Officials say officers arrived at his home and found an unloaded P80 “ghost gun” in his closet. Police say the gun did not have a serial number and it appeared to be the same gun shown in the Snapchat post.

Authorities say the gun was seized by police and the 17-year-old student was arrested and booked at the Juvenile Detention Facility for Possession of a Firearm on School Grounds.