“Collectively all of these items certainly suggest a specific recipe for large-scale destruction,” said Peter Tyler, Ithaca’s police chief, who praised the work of local and federal investigators.

Mr. Reynolds had been on leave from Cornell since after the 2016 fall semester and was taking classes at a local community college. After the raid on his apartment, Mr. Reynolds voluntarily sought treatment at a hospital. He was arrested and charged on Thursday. At a hearing on Friday, his lawyer, Raymond M. Schlather, said in court that Mr. Reynolds had been diagnosed with bipolar disorder and schizoaffective disorder with paranoid features, according to the Cornell Daily Sun, the campus newspaper.

The government has charged Mr. Reynolds with four federal crimes: possessing a silencer, owning an explosive device and providing two false statements in the process of paying a friend to purchase the rifle for him. He will remain in custody while he undergoes the examination to determine if he is competent to stand trial. Each of the four charges carries a maximum of up to 10 years in prison.

AR-15-style rifles have been used in several high-profile school shootings, but Mr. Reynolds’s friends said the former student feared those very attacks and may have acquired the weapons to protect himself and those he knew.

Mr. Reynolds’s lawyer said his client “is ill” and that preliminary indications show “that there were no targets, that there were no plans, and that the materials and conduct at issue were defensive in nature, arising out of his medical condition.”