Robel Phillipos, 19, appeared in federal court in Boston on May 1 after he was charged with lying to investigators about marathon bombing suspect Dzhokhar Tsarnaev. / Jane Flavell Collins, AP

by Donna Leinwand Leger, USA TODAY

by Donna Leinwand Leger, USA TODAY

At 4 p.m on April 18, three days after the Boston Marathon bombing, Dzhokhar Tsarnaev gave his buddy Azamat Tazhayakov a ride home from an afternoon class at University of Massachusetts-Dartmouth to the New Bedford apartment he shared with Dias Kadyrbayev.

An hour later, Tsarnaev's face beamed to billions of televisions and websites around the world as a Boston Marathon bombing suspect.

That's when, federal officials say, Tazhayakov, Kadyrbayev and a third friend, Robel Phillipos, came up with a plan to protect their friend - and instead, it has landed all three in federal court on charges of obstructing the bombing investigation and lying to investigators.

As it dawned on the college pals that their friend appeared to be one of the marathon bomber, the three 19-year-olds went on a nighttime raid to Tsarnaev's campus dorm room in Pine Dale Hall, snatched his laptop, a backpack of fireworks and jar of Vaseline and then headed off to their New Bedford apartment to figure out their next move, FBI Special Agent Scott Cieplik said in an affidavit unsealed Wednesday.

Kadyrbayev's attorney, Robert Stahl, said his client did not know the items were involved in the bombing and would be valuable evidence. Tazhayakov's attorney, Harlan Protass, said Tazhayakov is cooperating with federal authorities and "looks forward to the truth coming out in this case."

"He considers it an honor to be able to study in the United States," Protass said.

Tazhayakov, Kadyrbayev, Phillipos and Tsarnaev met on the UMass campus in 2011 and grew closer over the years, court documents say. Tazhayakov, Kadyrbayev and Tsarnaev speak Russian. Tazhayakov and Kadyrbayev shared an apartment on Carriage Drive in New Bedford. All four socialized together, the documents say. At least three of the men are pictured together, arms intertwined in a photo taken in New York City's Times Square a year ago.

Tazhayakov told investigators that he, Tsarnaev and some friends set off fireworks along the banks of the Boston's Charles River earlier this year.

On April 17, Kadyrbayev drove to campus, texted Tsarnaev and met him outside the dorm. He noticed Tsarnaev had cut his hair, the affidavit says, losing the curly locks that peeked out from under the white baseball cap in the photo that would be seen around the world the next day. Tsarnaev hung out at the New Bedford apartment until midnight.

Federal agents say the three men knew immediately after the surveillance photos became public that their friend was suspected of bombing the marathon.

Kadyrbayev told investigators he and Phillipos spoke about the news that evening and noted that the suspect resembled Tsarnaev. Kadyrbayev then texted Tsarnaev to note the resemblance. Tsarnaev, in a text Kadyrbayev says he interpreted as a joke, said "you better not text me."

Later that night, the three friends met up at Tsarnaev's dorm room. His roommate let them in, saying Tsarnaev had left several hours earlier, court papers say.

"They noticed a backpack containing fireworks. The fireworks had been opened and emptied of powder," the affidavit said. "Kadyrbayev knew when he saw the empty fireworks that Tsarnaev was involved in the Marathon bombing."

Back at the New Bedford apartment, they stayed up most of the night watching the news. Eventually, the friends threw Tsarnaev's backpack and fireworks in the trash outside the apartment, court papers say.

Kadyrbayev took the backpack, court papers say, because he wanted to help his friend Tsarnaev avoid trouble.

Immigration and Customs Enforcement agents say they arrested Kadyrbayev and Tazhayakov, both citizens of Kazakhstan, on April 20 for technical violations of their student visas. U.S. Marshals took custody of the men Wednesday after a judge unsealed the federal charges.

UMass-Dartmouth terminated Tazhayakov's student status on Jan. 3 for failing to meet the requirements of a student visa, according to a senior law enforcement official who has been briefed on the investigation but is not authorized to comment publicly. Despite the change in his status, Tazhayakov returned Jan. 20 to the U.S., entering the country unlawfully, the official said. The university terminated Kadyrbayev's student status on Feb. 27, the official said.

The Student Exchange Visitor program requires that foreign students attend classes, maintain their grades and meet other student requirements to retain their visas.