A Florida middle school student was arrested after allegedly sending messages to a group chat threatening to carry out a school shooting.

The 13-year-old Carwise Middle School student was arrested on Saturday, according to the Pinellas County Sheriff's Office.

Deputies said the teenage boy sent messages in a group chat on Snapchat to another student about carrying out a shooting at the school, Fox 13 reported.

DISGRUNTLED WAWA CUSTOMER IN FLORIDA ATTACKS COUPLE WITH WINE BOTTLE AFTER THEY REFUSED TO PAY FOR IT: POLICE

Pinellas County Sheriffs Office vehicle

A Florida middle school student was arrested after allegedly sending messages to a group threatening to carry out a school shooting. (Pinellas County Sheriffs Office)

The suspect threatened to shoot the other student first if he told anyone about his messages. That student later told his parents about what happened, and his parents alerted law enforcement.

When deputies arrived at the suspect's home, the 13-year-old admitted that he sent the messages, but he claimed he was only joking when he sent them, according to deputies.

FLORIDA SUBSTITUTE TEACHER SENT PORNOGRAPHIC VIDEOS TO STUDENTS, INCLUDING ONE MINOR: SHERIFF

Pinellas County Sheriff's Office badge

The 13-year-old admitted to deputies that he sent the messages, but he claimed he was only joking. (Pinellas County Sheriff's Office)

CLICK TO GET THE FOX NEWS APP

The teenage suspect was arrested following an investigation and charged with written threats to kill or conduct a mass shooting.

The 13-year-old boy was transported to the Pinellas Juvenile Assessment Center.