A 12-year-old Texas boy was arrested on Thursday for allegedly threatening to shoot up a Dallas-area prep school.

The Dallas Morning-News reported the seventh grader at the Jefferson campus of Trinity Basin Preparatory in North Oak Cliff had allegedly told another 12-year-old student he was planning on bringing a gun and opening fire at the school. Dallas Assistant Police Chief Randy Blankenbaker said he tried to get another student involved in his scheme.

Blakenbaker said the other student thought the suspect was joking until Thursday when he showed him what was described as a “written diagram detailing how the plan would be carried out,” according to the Morning-News.

“He did what he needed to do to help protect himself and his classmates and he’s to be commended for that,” Blankenbaker said of the student who tipped off police.

The student was taken to Henry Wade Juvenile Justice Center in Dallas. He has been charged with violating the education code-exhibition of firearms, a third-degree felony, according to the Morning-News. He did not have a weapon when he was arrested.

The Morning News reported another boy was arrested in the same instance on Oct. 20. A 15-year-old was arrested in the Dallas area for allegedly threatening to shoot up North Forney High School. The teen reportedly told other students he was going to bring in a gun the next day.

Click for more from the Dallas Morning News.