A Rancho Cotate High School student posted on Snapchat a photo of an airsoft rifle meant to look like a real assault weapon on someone’s lap with a chilling message: “Don’t go to school tomorrow.”

The 17-year-old student told police the post was a joke. Nevertheless, he was arrested around 11 p.m. Sunday on suspicion of criminal threats, said Aaron Johnson, a deputy chief at the Rohnert Park Department of Public Safety. The teen was booked into Sonoma County Juvenile Hall, where he remained Monday.

“It happens every once in awhile and we take them seriously,” Johnson said about online threats of violence.

A Snapchat spokesperson said a user spotted the post and flagged it for review. Snapchat removed the picture within hours of it being posted and reported it to the FBI, police said.

Snapchat declined to comment on when the picture was uploaded and removed.

Police got a warrant to search the teen’s home Sunday evening after obtaining his internet address and Snapchat account information from the FBI. Police did not find a weapon, but the teen told investigators the replica assault rifle in the picture was made to look real and belonged to a friend.

The 16-year-old friend, also a Rancho Cotate student, cooperated with police and handed over the airsoft rifle, which was confiscated as evidence.

“I don’t think they realized how fast social media spreads and how large social media networks are, or the magnitude of fear any time you talk about school safety,” Johnson said of the teens.

Johnson said the gun looked and felt realistic, in terms of size and weight. “You have to disassemble the gun to know it’s not a real assault rifle,” he said.

Louis Ganzler, principal at Rancho Cotate, sent a short email at 6:42 a.m. Monday to parents and students, informing them the school had been alerted by police about a potential threat posted on social media. However, he said police determined there was no threat to student safety.

“Our admin team will continue to monitor the situation and maintain constant communication with the police,” Ganzler wrote in the email.

Ganzler said students and staff members felt police officers had done their jobs, and students went to class and had a regular school day on Monday.

However, some parents were critical of Ganzler’s email, saying it was brief and provided few details of the situation.

Tony Roehrick, interim superintendent at the Cotati-Rohnert Park school district, said online threats don’t happen frequently in the district.

“We felt confident after conferring with police that there was no threat to the school,” Roehrick said.

You can reach Staff Writer Susan Minichiello at 707-521-5216 or susan.minichiello@pressdemocrat.com. On Twitter @susanmini.