A Maryland high school student was arrested and charged with threat of mass violence after police say they discovered evidence revealing the teen had plans to commit a school shooting, authorities said Thursday.

The arrest on Wednesday came after authorities discovered a 129-page document they say was written by 18-year-old Alex Ye, the Montgomery County Department of Police said in a news release Thursday.

Authorities learned of the writings following an exchange Ye had via Instagram messaging with an unidentified person who felt a school shooting was “imminent,” according to the teenager’s arrest warrant. The unidentified person knew Ye from an inpatient treatment at a local psychiatric facility, the warrant says.