Two of those in custody, Azamat Tazhayakov and Dias Kadyrbayev, both originally from Kazakhstan, were friends with bombing suspect Dzhokhar Tsarnaev, according to Linda Cristello, an attorney representing the men.

Tazhayakov is a student at the University of Massachusetts-Dartmouth, where Tsarnaev went to school. The university said it suspended Tazhayakov pending resolution of the case.

The third man, Robel Phillipos, 19, of Cambridge, was also a friend of Tsarnaev and a one-time classmate at UMass-Dartmouth, investigators said. The university said he is no longer a student there.

Tazhayakov and Kadyrbayev were charged with conspiracy to obstruct justice. Investigators said they removed a backpack containing fireworks and a laptop from Tsarnaev's dorm room after concluding that he was one of the suspects.

Phillipos was charged with willfully making materially false statements to federal lawenforcement officials during a terrorism investigation.

Tazhayakov and Kadyrbayev appeared in court Wednesday afternoon and agreed to voluntary detention. Their next hearing is scheduled for May 14.

Phillipos also appeared in court and had a detention hearing scheduled for Monday.

According to an FBI affidavit, the three men were watching a movie in Tsarnaev's room when they saw the backpack. The fireworks in the backpack had been emptied of gunpowder, according to the affidavit.

Investigators said the three had thought that photos of one of the bombing suspects looked like Tsarnaev, but they determined that he was the suspect when they saw the fireworks.

According to the affidavit, Kadyrbayev threw the backpack into a trash bin.

Photos: Honoring Boston Marathon bombing victims, survivors

1 of 57

Three people were killed and more than 250 injured in the two bombings that rocked the Boston Marathon. Just days later, an MIT police officer was killed.

Investigators said Phillipos initially lied about going to Tsarnaev's dorm room. During a fourth interview with investigators, Phillipos admitted that the three had been in the room and that Kadyrbayev had removed the backpack, according to the affidavit.

Tazhayakov and Kadyrbayev have been held in a county jail for more than a week on immigration violations.

Investigators spent several days searching a Dartmouth landfill for evidence in connection with the bombings last week.

Boston police said the three people do not pose a danger to the public.

"Boston is safer now than it has ever been," Menino said. "Law enforcement is doing their job, and I'm not worried at all."

Three people were killed and more than 260 injured on April 15 when two bombs exploded near the finish line of the Boston Marathon.

Suspect Tamerlan Tsarnaev died after a gunfight with police in Watertown several days later. His brother was found hiding in a Watertown neighborhood and is at a prison hospital.

Tamerlan Tsarnaev's relatives will claim his body now that his wife has agreed to release it, an uncle said. Tamerlan Tsarnaev, 26, has been at the medical examiner's office in Massachusetts since he died after a gunfight with authorities more than a week ago.

IT IS SAID THEIR ACTIONS AFTER THE BOMBINGS WERE CRIMINAL. THEY SAID THEY HAD NO KNOWLEDGE BEFORE. THE CRIMINAL COMPLAINT INDICATES THESE MEN WERE FRIENDS OF DZHOKHAR TSARNAEV AND ACTED TO COVER EVIDENCE ONCE THEY SAW HIS PICTURE ON TELEVISION BECAUSE THEY WERE WORRIED HE MIGHT GET IN TROUBLE. THIS PHOTOGRAPH SHOWS TWO OF THE MEN IN CUSTODY ALONG WITH THE SUSPECT IN TIMES SQUARE. ON THE LEFT, AZAMAT TAZHAYAKOV, AND IN THE MIDDLE, DIAS KADYRBAYEV, AND THE THIRD MAN ROBEL PHILLIPOS, FROM CAMBRIDGE. THE TWO ARE ACCUSED OF CONSPIRACY IN THE INVESTIGATION OF THE BOSTON MARATHON BOMBING, CHARGES THEIR ATTORNEYS DISPUTE. HE AND HIS FAMILY ARE VERY SORRY ABOUT WHAT HAPPENED IN BOSTON, AND HE HAD NOTHING TO DO WITH IT. I FEEL HORRIBLE AND WAS SHOCKED THAT SOMEBODY HE KNEW FROM DARTMOUTH WAS INVOLVED IN THE BOSTON MARATHON BOMBINGS. WHEN THE PHOTOGRAPHS OF THE SUSPECTS WERE RELEASED THREE DAYS AFTER, PAPERWORK SAYS DZHOKHAR TSARNAEV SAID HE LOOKED LIKE THE SUSPECT ON TELEVISION. "YOU HAD BETTER NOT TEXT ME, AND GO TO MY ROOM AND TAKE WHATEVER YOU WANT." HE TOLD THE FBI HE THOUGHT HE WAS JOKING, BUT HE DID GO TO HIS DORM ROOM ALONG WITH THE OTHER TWO. THE PAY BOARD SAID THEY NOTICED A BACKPACK CONTAINING FIREWORKS, FIREWORKS THAT HAD BEEN OPENED AND EMPTIED OF THE POWDER. WHEN THEY SAW THAT, THEY KNEW HE WAS INVOLVED IN THE BOMBING. HE DECIDED TO REMOVE THE BACKPACK FROM THE ROOM IN ORDER TO HELP HIS FRIEND AVOID TROUBLE. THEY ARE BOTH NATIONALS OF KAZAKHSTAN AND. THEY HAVE AGREED TO VOLUNTARY DETENTION AND WILL REMAIN IN CUSTODY. TAMERLAN BOUGHT FIREWORKS.