Two New Jersey men charged with assaulting Capitol Police Officer Brian Sicknick and others during the Jan. 6 insurrection in Washington will remain in custody pending trial, a federal judge ruled Tuesday, despite evidence that cast certain aspects of the government’s case against them into doubt.

Julian Khater, 32, and George Tanios, 39 — who grew up together in New Brunswick before moving to State College and Morgantown, W.Va., respectively — have been behind bars since their arrest in March.

But in hearings over the last two weeks, attorneys for both men attempted to convince the court that their clients were no more dangerous than countless other Capitol rioters who have been released on bond.

In Khater’s case, 16 family members offered to put up $15 million of property as collateral should the judge release him. Tanios’ attorney Elizabeth Gross, meanwhile, wrung an admission from prosecutors that one of the more eye-opening aspects of their case had already proven not to be true.

Initially, government lawyers had alleged Khater and Tanios drove to Washington together on Jan. 6, stopping along the way at a gun dealership to pick up bear spray that Khater later used to spray Sicknick and two other officers as an unruly mob fought their way into the Capitol building.

But since her client’s arrest, Gross produced the still-unused canister of bear spray that Tanios purchased that day. Lawyers for both men argued they brought it not as part of a planned plot to attack officers but to defend themselves should violence erupt — as had happened at previous rallies of Donald Trump supporters in Washington.

“His only plans were attend this rally,” Gross said. “It wasn’t to go to a riot. It was to go to support their president.”

» READ MORE: Capitol cop Brian Sicknick and his accused attackers both had N.J. roots and supported Trump

Still, Khater was caught on video spraying something that elicited a physical reaction from Sicknick and other officers. While conceding they got the bear spray wrong, prosecutors argued it was more likely pepper spray.

And regardless of whether or not Khater and Tanios used bear spray, Assistant U.S. Attorney Gilead I. Light said, the fact that they stopped to stock up on chemical agents suggests their role in the violence was premeditated.

“Why are they buying bear spray to go to a city?” he asked in court last week. “It’s an uncontested fact that there are no bears in downtown D.C. … There’s really only one explanation for why: that they understood what was going to happen on Jan. 6 and they were prepared to use it.”

U.S. District Judge Thomas F. Hogan was inclined to agree. After reviewing body cam footage from the three injured officers and video circulated on social media, he concluded both men continue to pose a danger to the community.

» READ MORE: Pennsylvania man charged with assaulting Officer Brian Sicknick with bear spray during Jan. 6 Capitol riot

Footage played for the court showed Khater approaching Tanios amid the chaos that erupted on the Capitol’s west side. “Give me that bear s—,” he can be heard saying , to which Tanios replied: “Hold on. Not yet, not yet, it’s still early.”

“The evidence when you look at it suggests that the defendants had a plan,” Hogan said Tuesday. “They talked it over at the foot of the Capitol, saw what was going on, and they had a plan to use those devices as weapons. … We had preparation and execution of a violent assault.”

More than 140 officers have reported injuries inflicted by the mob of rioters who attacked the Capitol that day, in some cases armed with bats, hockey sticks, and sledgehammers. Sicknick is the only one to have died in the hours that immediately followed.

A 13-year Capitol Police veteran who grew up in South River, N.J., he collapsed just after the Capitol was cleared. And while investigators initially said they were pursuing a murder investigation, a medical examiner’s recent finding that Sicknick suffered two strokes and died of natural causes — and not exposure to a chemical irritant as initially suspected — has complicated those efforts.

Khater and Tanios are charged with counts including conspiracy, assaulting officers, civil disorder, and obstruction of Congress — the most serious of which could send them to prison for up to 20 years.