BOSTON — A friend of the accused Boston Marathon bomber charged with obstruction watched a garbage truck haul away a backpack containing fireworks he and two other men had taken from the suspect’s dorm room, an FBI agent testified on Thursday.

The friend, Azamat Tazhayakov, is the first of three friends of accused bomber Dzhokhar Tsarnaev to face trial. He is charged with removing evidence from the Tsarnaev’s room at the University of Massachusetts Dartmouth and throwing away the backpack as the FBI searched for the suspect, who is accused of killing three people and injuring 264.

FBI Special Agent Farbod Azad said that Tazhayakov told him he and the two friends went to the room, where they found fireworks shells, some of which had been emptied of gunpowder, and a container of Vaseline — supplies that he and his friends thought might have used by the Tsarnaev brothers to make the bombs.

They brought the backpack and fireworks to their New Bedford, Massachusetts, apartment and later watched a garbage truck haul it away after his roommate and fellow Kazakh exchange student Dias Kadyrbayev dropped it into a dumpster.

“He said the last time he had seen the backpack was when Dias brought it out to the dumpster to get rid of it,” said Azad, who interviewed Tazhayakov the day after the alleged visit to Tsarnaev’s room. “He eventually told us that he had been at the apartment and looking out the window or out the back at the dumpster area and then watched as a garbage truck came and removed the contents of that dumpster.”

Prosecutors contend that Tazhayakov and Kadyrbayev, accompanied by a third friend, went to Tsarnaev’s dorm room hours after the FBI released photos showing Tsarnaev and his older brother, Tamerlan, asking the public’s help in identifying the suspected bombers. The three are charged with disposing of the backpack while the FBI was searching for Tsarnaev.

Tazhayakov’s attorneys have said he never touched the backpack or fireworks, contending that was Kadyrbayev’s doing.

“Another thing he said was that while Dias was looking through some things, he picked up a container of Vaseline and either whispered or mouthed the words to Azamat about, ‘He used this to make the bomb’ or ‘Do you think he used this to make the bomb?’” Azad said during the fourth day of Tazhayakov’s trial in U.S. district court in Boston.

Tazhayakov could face up to 25 years in prison if convicted of obstruction of justice and conspiracy. Kadyrbayev faces the same charges.

A third man, Robel Phillipos of Cambridge, Massachusetts, is accused of the lesser charge of lying to investigators.

Trials for Kadyrbayev and Phillipos are scheduled for later this year.

None of the three friends are charged with playing a role in the bombing.

Tsarnaev is awaiting trial, set for November, on charges that carry the death penalty if he is convicted. His older brother, Tamerlan, died after a gun battle with police on April 18, 2013, three days after the bombing.