Derek Shrout, a 17-year-old student at Russell County High School in Seale, was scheduled to appear at a Monday afternoon court hearing.
Shrout was apprehended after a journal was found by a teacher and turned over to authorities, Russell County Sheriff Heath Taylor said.
"The journal contained several plans that looked like potential terrorist attacks, and attacks of violence and danger on the school," Taylor told WTVM-TV. "And in particular, there were six students specifically named, and one teacher."
A search of Shrout's home found several small tobacco cans and two large cans, all with holes drilled in them and containing pellets, Taylor told the Columbus Ledger-Enquirer.
The devices were just "a step or two away from being ready to explode," the sheriff said.
Taylor praised the efforts of school officials and others.
"The system worked and thank God, it did," he said. "We avoided a very bad situation."
Seale is about 80 miles east of Montgomery.