SALT LAKE CITY — A man who allegedly threatened to commit a mass shooting at a Utah County high school if someone didn’t buy his tablet has been arrested.

Matthew Brooksby, 21, of Pleasant Grove, recently placed an online ad on KSL Classifieds to sell his tablet, according to a Utah County Jail booking affidavit.

“If this tablet (isn’t) sold within 24 hours I will use my gun and shoot up the classrooms at timpanogos high school I just want my tablet sold,” the message stated, according to the affidavit.

Police contacted Brooksby, who initially denied making the threat. But later, his grandfather called Orem police and said “he had spoken with Matthew throughout the night about the seriousness of the crime, and Matthew did confess to writing the threat on KSL,” the affidavit states.

Officers returned to the home and booked Brooksby into the Utah County Jail on Wednesday morning for investigation making a threat of terrorism.

In a Facebook post, Orem police said they believe mental health concerns contributed to the alleged threats.

“Before passing too much judgement understand that the man suffers from a traumatic brain injury which may have played into the bad choice he made,” police wrote.