BOSTON -- Bomb threats that led to the evacuations of four Harvard University campus buildings this week were made by a student trying to get out of taking a final exam, federal prosecutors said Tuesday.

The student, 20-year-old Eldo Kim, sent emails saying bombs had been placed around campus to Harvard police, two university officials and the president of the Harvard Crimson newspaper, according to a criminal complaint filed by the U.S. attorney's office.

The messages said shrapnel bombs would go off soon in two of four buildings, including one where prosecutors say Kim was supposed to take an exam at 9 a.m. Monday. The buildings, on Harvard's campus in Cambridge, just outside Boston, were shut down for hours before investigators determined there were no explosives.

Kim, who lives in Cambridge, is to make an initial court appearance Wednesday. It was unknown if he had an attorney.

Investigators from several agencies searched the campus buildings for hours before determining there were no explosives. One of the buildings was a freshman dormitory; classes are held in the other three.

Harvard said in a statement it was "saddened" by the allegations in the federal complaint but would have no further comment on the ongoing criminal investigation.

An FBI affidavit filed Tuesday says Harvard determined Kim had accessed TOR, a free Internet product that assigns a temporary anonymous Internet protocol address, using the university's wireless network.

The affidavit says Kim told an agent on Monday night he had acted alone and sent the messages to five or six Harvard email addresses he picked at random.

Kim's LinkedIn profile says he is an undergraduate scholar at Harvard's Institute for Quantitative Social Sciences. The institute's website says he is a research assistant who has worked for a professor analyzing partisan taunting and also writes for the Harvard International Review and dances as a member of the Harvard Breakers.

The maximum penalties for a bomb hoax are five years in prison and a $250,000 fine, prosecutors said.