Jessica Nguyen, a 12-year-old honor student who was found slain in her family’s Gaithersburg basement, was stabbed and cut more than 40 times, but police never found the small sword thought to be the murder weapon, Montgomery County authorities said in a court hearing Friday.

It was the most detailed accounting yet of the case against David R. Hang, 42, who was married to Jessica’s mother. The case rests on both extreme violence and an odd motive, one linked to a sham marriage in which Hang was allegedly paid at least $20,000 to help Jessica’s mother gain U.S. citizenship.

At the end of the hearing, District Court Judge James B. Sarsfield ruled that prosecutors had sufficient cause to hold Hang.

Hang’s attorney, Brian Shefferman, argued that prosecutors were engaging in “wild speculation” and didn’t demonstrate probable cause.

“Mr. Hang absolutely denies he has anything to do with this,” Shefferman said after the hearing. “He’s just totally devastated that he’s been accused of this.”

Wearing a green jail jumpsuit, Hang shook his head as assertions were made against him. He was in handcuffs throughout the hearing, during which he sat within 30 feet of Jessica’s family members.

Authorities say the family first met Hang, who had worked as a Montgomery transit bus driver, after seeing an advertisement he posted in a Vietnamese-language magazine. The family eventually agreed to pay Hang $20,000 to $25,000 so Jessica’s mother, Khen Kim Vu, could gain U.S. citizenship, according to Detective Dan Krill, who testified Friday.

“The purpose of this marriage was solely to allow [Jessica’s mother] to gain U.S. citizenship,” Krill said.

They married in June 2006, with Hang agreeing to help support Jessica and Jessica’s older sister, Krill said. By January 2007, Hang had moved out, Krill said.

Hang met another woman and filed for divorce, authorities said. Jessica’s mother initially contested it, demanding Hang pay child support, according to court records. She eventually backed off but wouldn’t agree to a divorce as quickly as Hang wanted it to happen, authorities said.

Hang’s new girlfriend — whom he later married in Colorado — was having health problems, and Hang wanted to get her coverage from his county insurance, Krill said. He said Hang went to county workers several times to discuss the move. “The employees at benefits explained to him that he cannot add his new girlfriend . . . because he was not divorced,” Krill said.

Hang grew more frustrated, according to authorities. “He was angry with the family,” prosecutor Stephen Chaikin told the judge. “The defendant committed a brutal murder against this family.”

The afternoon of May 31, Jessica and her sister came home from school about 3 p.m., according to the prosecution. Jessica’s sister fell asleep before starting her homework. At 7:30 p.m., authorities said, she went looking for her little sister — and found her bloody body in the basement.

Chaikin said during an earlier hearing that Hang at one point had a key to the townhouse. He said boot prints were found in the blood near the body — prints left by the brand of boots issued to county Ride-On bus drivers. Police found a sheath for a small sword near Jessica but never found the weapon.

Detectives who interviewed Hang the next day said his right hand was swollen. Chaikin said that likely was caused by his hand bumping against the sword’s hilt.

Chaikin said that Hang’s DNA was found on the sheath.

Shefferman noted Hang had lived in the townhouse and said that could explain why his DNA would be on the sheath. And he said Chaikin was talking about hand injuries from an alleged murder weapon that was never found.

“To say that there was a hilt is wild speculation,” Shefferman said.

He said that a week before Jessica died, her mother and Hang settled their differences in the divorce case. “The alleged motive is really speculative,” Shefferman said.