Jenna Schrader, 18 and a senior, was in the library. She was calm, she said later, reasoning that if the situation was truly dire, the school would have gone into full lockdown with even more extreme measures.

After 45 minutes, though, other students began to grow nervous, she said.

“You always think about what could happen,” she said.

As the students waited, police went to Mr. Dornbush’s home, a pale yellow house with burgundy shutters, where he lived with his parents. Nobody was home.

Mr. Dornbush’s parents, called by police, told them that their son was at school. The Midwest Technical Institute in Moline, Ill., where he is studying welding, was a short drive down the river.

After a while, Mr. Dornbush returned a call from police on his phone and drove up Route 84 from Moline under strict instructions from the officers. Trailed by unmarked police cars, he drove directly to the Fulton Police Department, where he was interviewed about the Snapchat messages, the police said. Lieutenant Pridemore said he arrested Mr. Dornbush, who was charged with two counts of felony disorderly conduct.

Mr. Dornbush was booked into the Whiteside County Jail, where he would remain until Wednesday afternoon, the authorities said, when he was released on $25,000 bond. Mr. Dornbush did not respond to messages, and a woman who answered the door at Mr. Dornbush’s house on Thursday declined to talk. He has yet to enter a plea in the case.

Lieutenant Pridemore said that a recent breakup with the student who got the Snapchat messages may have been behind what had happened.