(CNN) -- (CNN) -- Three friends of Boston Marathon bomb suspect Dzhokhar Tsarnaev have been jailed on charges they tried to throw investigators off Tsarnaev's trail, federal prosecutors announced Wednesday.
Two of them, Azamat Tazhayakov and Dias Kadyrbayev, were already in federal custody on immigration charges, their lawyers told CNN. Both are from Kazakhstan and had student visas.
The third, Robel Phillipos, is a U.S. citizen. Tazhayakov and Kadyrbayev are charged with obstruction of justice, while Phillipos is charged with lying to federal agents probing the bombing, according to court papers.
They made their first appearance before a federal magistrate Wednesday afternoon, when they were read the charges against them and informed of their rights.
All three are accused of removing items from Tsarnaev's dorm room after the April 15 bombings, which killed three people and wounded more than 260.
About a month before the marathon attack, Tsarnaev had told Kadyrbayev and Tazhayakov "that he knew how to make a bomb," according to an FBI affidavit recounting the charges. Kadyrbayev told investigators that Tsarnaev "appeared to have given himself a short haircut" two days after the bombings.
And on April 18, when the FBI released photographs of bomb suspects later identified as Tsarnaev and his older brother Tamerlan, Kadyrbayev texted his friend to tell him "he looked like the suspect on television." Tsarnaev texted back "lol" and added, "come to my room and take whatever you want," the affidavit states.
Phillipos, Tazhayakov and Kadyrbayev went to the room, where Kadyrbayev noticed a backpack containing fireworks that had been "opened and emptied of powder," according to the affidavit.
"Kadyrbayev knew when he saw the empty fireworks that Tsarnaev was involved in the marathon bombing," the affidavit states.
They left with the backpack and Tsarnaev's laptop. By the time they got back to the apartment in New Bedford that Tazhayakov and Kadyrbayev shared, the Tsarnaev brothers had been named as bomb suspects and the three friends "started to freak out," Phillipos recounted.
"According to Kadyrbayev, they collectively decided to throw the backpack and fireworks into the trash because they did not want Tsarnaev to get into trouble," the affidavit states. Investigators found the pack after a two-day search of a New Bedford landfill last week.
Alan Dershowitz, a prominent defense attorney and Harvard law professor, called the obstruction charge "weak," suggesting it was meant to pressure the suspects into providing more information on Tsarnaev.
"If that's the best the feds have now, then they're just squeezing," Dershowitz told CNN. "It doesn't sound like they have very much new here."
Tamerlan Tsarnaev died after a gun battle with police early in the morning on April 19. Dzhokhar Tsarnaev was arrested that night in a Boston suburb and is being treated for gunshot wounds at a federal Bureau of Prisons medical center in Devens, Massachusetts.
Tazhayakov and Kadyrbayev appear in a photograph with Dzhokhar Tsarnaev taken in New York's Times Square during an earlier visit. They were taken into custody last month on charges that they had violated the terms of their student visas, Kadyrbayev attorney Robert Stahl told CNN.
Stahl said Kadyrbayev "did not attend class regularly." Federal law enforcement sources said at the time that the Kazakh students were being detained "in an abundance of caution" because authorities wanted detailed information on the Tsarnaevs' movements in the weeks and days before the attack.
One of the reasons Kadyrbayev drew investigators' attention was because of changes to his Facebook page, a source briefed on the Boston probe said. Kadyrbayev and Dzhokhar Tsarnaev changed their profile photos within 15 minutes of each other in the pre-dawn hours of April 19, while the Tsarnaevs were on the run, the source said.
Tsarnaev, who appears to have had access to a wireless device at that time, changed his to a black-and-white photo, while Kadyrbayev changed his photo to one of him wearing an Iron Man mask, the source said.
CNN's Susan Candiotti, Deborah Feyerick, Carol Cratty, Jake Tapper, Brian Todd, Pamela Brown and Kathleen Johnston contributed to this report.