An eccentric computer hacker was sentenced Monday to nine years in prison for the fiery death of a man who was helping him secretly dig tunnels for a nuclear bunker beneath a Maryland home.

Daniel Beckwitt, 28, appeared teary-eyed as he apologized to the parents of 21-year-old Askia Khafra, who was reportedly charred beyond recognition by the September 2017 fire that broke out above the tunnels they were digging in a Washington, D.C. suburb.

"If there was something I could do to bring Askia back — anything — I would jump at that chance," said Beckwitt. "I most certainly did not intend for any of this to happen."

Beckwitt had faced a maximum of 30 years in prison when Montgomery County Circuit Court Judge Margaret Schweitzer sentenced him. In total, Beckwitt was sentenced to 21 years but the judge suspended all but nine years of the sentence.

"Askia's death has left me broken," said Claudia Khafra, Askia Khafra’s mother. "I am constantly plagued by feelings of emptiness."

During the trial, Montgomery County prosecutor Marybeth Ayres accused Beckwitt of recklessly endangering Khafra's life. The prosecutor accused Beckwitt of ignoring the signs of danger and sacrificing safety for secrecy while they dug a network of tunnels beneath a home in Bethesda.

Defense attorney Robert Bonsib had told jurors the fire was an accident, not a crime. He described his client as an idiosyncratic but "incredibly brilliant" man who never intended any harm.

HERO TEEN, TODDLER HE TRIED TO SAVE OF INJURIES FROM BRONX FIRE

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

GET THE FOX NEWS APP

Khafra's parents filed a wrongful death lawsuit against Beckwitt on the anniversary of the Sept. 10, 2017, fire.

The Associated Press contributed to this report.