Firefighters found a 21-year-old man's charred, naked body when they entered a burning home littered with mounds of trash. A hole in the basement floor led them to a network of tunnels under the house.

Fire investigators swiftly concluded that the Maryland home was a crime scene, a deadly end to a wealthy stock trader's campaign to build an underground bunker for protection from a nuclear attack. Daniel Beckwitt, a 27-year-old millionaire who grew up in the house, was charged with second-degree murder and involuntary manslaughter in the September 2017 death of Askia Khafra.

When Beckwitt's trial starts this week, his attorneys likely will try to persuade jurors that Khafra's death was a tragic accident. Beckwitt risked his own safety in a failed attempt to rescue his friend from the blaze, his lawyers have said.

Jury selection for Beckwitt's trial is scheduled to start Monday in a Montgomery County courtroom. And a judge recently ruled that jurors can hear testimony about evidence that investigators found in the fire-gutted house in Bethesda, a suburb of Washington, D.C.

Beckwitt's lawyers argued that investigators conducted illegal, warrantless searches of the home and later secured a search warrant based on misleading information. A police affidavit falsely suggested the fire had been deliberately set by someone who provided investigators with inconsistent information about the cause of the fire, defense attorneys said.

Prosecutors said investigators properly obtained and executed the search warrant under difficult circumstances, including the extreme hoarding conditions inside the home. Piles of trash and debris covered most of the floors and reached the ceiling in spots, hindering the search for evidence.

Montgomery County Circuit Court Judge Cheryl McCally last month denied defense lawyers' request to suppress all the evidence seized from the home. The judge said the "unique circumstances" of the search justify the weeks it took for investigators to complete it.

Investigators found Khafra's body in the basement, where a hole in the concrete floor led to a shaft that dropped down 20 feet (6 meters) into tunnels that branched out roughly 200 feet (60 meters) in length. The tunnels had lights, an air circulation system and a heater powered by a "haphazard daisy chain" of power strips that created a fire risk, Montgomery County prosecutor Douglas Wink said during a hearing last year.

Hours before the fire, Khafra texted Beckwitt to warn him it smelled like smoke in the tunnels. Beckwitt flipped a breaker that turned off lights in the tunnels but turned the power back on after Khafra said he couldn't see, Wink said, accusing Beckwitt of ignoring "obvious signs" of danger.

Beckwitt told a detective he and Khafra were close friends and business partners. He said he had invested $6,000 in a business venture of Khafra's after meeting him online. In exchange, Khafra agreed to help Beckwitt dig his tunnels.

Khafra's parents filed a wrongful death lawsuit against Beckwitt on the anniversary of the Sept. 10, 2017, fire. His father, Dia Khafra, said during an interview last year that he and his wife tried to persuade their son to stay away from Beckwitt's tunnels.

"I always feared something dangerous would happen to him," Dia Khafra said.

Beckwitt went to extraordinary lengths to maintain his project's secrecy. He tried to trick Khafra into thinking they were digging the tunnels in Virginia instead of Maryland. Beckwitt told investigators he would pick Khafra up in a rental car and drive him to Manassas, Virginia, where he had the younger man don "blackout glasses" before driving him around for about an hour, according to a police report.

Khafra worked in the tunnels for days at a time, sleeping there and urinating and defecating into a bucket Beckwitt lowered into the tunnels. Khafra had a cellphone, but Beckwitt used internet "spoofing" to make it appear he was in Virginia, according to Wink.

The prosecutor described Beckwitt as a skilled computer hacker who had a paranoid fixation on a possible nuclear attack by North Korea.

When he was a student at the University of Illinois, campus police arrested him in 2013 on charges including computer fraud. He was suspected of installing keystroke logging devices on the Urbana school's computers. He pleaded guilty and was sentenced to two years of probation, according to online court records.

In 2016, after he moved back to Maryland, Beckwitt spoke at a hacker convention using the alias "3AlarmLampscooter" and wearing a fire-resistant suit and visor that obscured his face. Wink said Beckwitt was teaching his audience how to make thermite bombs to destroy computer data "in order to get away with hacking." Defense attorney Robert Bonsib has said Beckwitt's use of a pseudonym and disguise was harmless, typical of the "weird things" people do on the internet.

Beckwitt's lawyers say he screamed for help from his neighbors after the fire broke out and tried to save Khafra from the fire, but heavy smoke and flames forced him to retreat. "Beckwitt made repeated efforts to locate Khafra and expressed concern for his friend and put his own safety at risk seeking (to) find and rescue his friend — efforts noted in the reports of the Fire and Rescue personnel who were on the scene," they wrote.