Nails, BBs, pressure cooker parts and other potential bomb components were found inside Boston Marathon bomber Dzhokhar Tsarnaev's family apartment, an FBI agent testified Wednesday.

The items were found during a search four days after the 2013 terror attack, which killed three people and injured more than 260 others.

Tsarnaev's lawyers have admitted that he and his older brother, Tamerlan, planted and detonated two pressure-cooker bombs in backpacks near the marathon finish line on April 15, 2013.

Prosecutors have said the bombs were filled with BBs, nails and other shrapnel. They have also said the bombs were made with fuses from Christmas tree lights. On Wednesday, jurors were shown a photo of a string of lights found inside in the Cambridge apartment.

The defense contends that Tamerlan was the mastermind of the attack and enlisted his younger brother, then 19, to help him. Tamerlan, 26, died days after the attacks when he was wounded during a gun battle with police and run over by Dzhokhar as he escaped. Dzhokhar was found more than 18 hours later, hiding in a boat parked in a yard in Watertown.

FBI Special Agent Christopher Derks was asked to show the jury items found in the Tsarnaevs' small, cramped apartment. Derks said the three-bedroom, one-bathroom apartment was smaller than 800 square feet and filled with clutter.

"It almost looked like a construction site. There were tools everywhere, lots of debris," Derks said.

He said the FBI seized whole drawers filled with tools, including a caulking gun, wire cutters and a soldering gun.

"The mindset was that these tools could be used to make a device," he said.

Also found in the apartment was a gasket to a pressure cooker and the top of a pressure cooker lid.

Derks identified various items belonging to Tsarnaev in the apartment, including his certificate of naturalization showing he had become a U.S. citizen. The brothers —ethnic Chechens — had lived in the former Soviet republic of Kyrgyzstan and the volatile Dagestan region of Russia before moving to the U.S. with their parents and two sisters about a decade before the bombings.

Derks said agents also found a book with two sheets of loose-leaf paper inside with handwritten notes, including the name Tarek Mehanna, a Sudbury man who was convicted of conspiring to help al-Qaida, and a reference to Anwar al-Awlaki, an America-born Muslim cleric and al-Qaida propagandist who was killed in a U.S. drone strike in Yemen in 2011. Derks did not say whose handwriting it was.

Defense lawyers contend that Tsarnaev, then a sophomore at the University of Massachusetts-Dartmouth, had not been living in the apartment for more than a year before the bombings, so most of what was found there did not belong to him. At the time of the bombings, Tamerlan Tsarnaev was living there with his wife and their young daughter.

During cross-examination of Derks, one of his attorneys, Miriam Conrad, asked to put into evidence a court filing by prosecutors from June 2014, when they opposed a defense motion to suppress evidence seized from the apartment by arguing that Dzhokhar Tsarnaev did not have an expectation of privacy there because he had moved out when he enrolled at UMass-Dartmouth in September 2011. The judge did not allow the document to be admitted.

"Are you aware that many of the items shown here today bore the fingerprints of Tamerlan Tsarnaev?" Conrad asked Derks.

Prosecutors objected before he could answer.

The jury was also shown evidence of a series of purchases Tamerlan Tsarnaev made in the days and weeks before the bombings, including two backpacks he bought April 14, 2013. Jurors were shown a receipt for the backpacks and surveillance video of Tamerlan Tsarnaev leaving a Target store April 14. The tattered remains of one backpack was recovered from the scene of the first bombing, while the other was found at the scene of the firefight with police in Watertown.

FBI agents said Tamerlan bought remote-controlled model cars, a transmitter and receiver, and boxes of BBs in the months before the bombings.

Prosecutors said previously that the remote-control detonators for the bombs used in the marathon were made from model car parts.