PLYMOUTH, New Hampshire—A monumental battle over federal power, state sovereignty, and individual liberty played out on Thursday in a small courtroom filled with law enforcement officers and casual marijuana users.

On one side: Customs and Border Protection, the federal agency that helps enforce immigration law, as well as the police department of Woodstock, New Hampshire.

On the other: Sixteen New Englanders caught with a few grams of marijuana, represented by the New Hampshire ACLU.

The question: Can federal officers conduct a search that is prohibited under New Hampshire law, then turn over the evidence to state police so that state prosecutors can file charges in state court?

The events that spurred this faceoff occurred in Woodstock on a late August weekend in 2017. Although the town is 90 miles south of Canada, CBP is authorized to conduct searches within 100 miles of an international border. So the agency, which the Trump administration has emboldened to conduct a nationwide crackdown on illegal immigrants, set up a checkpoint in Woodstock. The ostensible “primary purpose” of the checkpoint was to enforce immigration law, and agents did demand proof of citizenship from drivers and passengers. But CBP also brought along drug-sniffing dogs, alleging that the canines would help them to “detect concealed humans.”

These dogs found no “concealed humans” at the checkpoint. They did, however, “signal” toward a number of cars, suggesting the presence of drugs. Some of these cars did, indeed, contain marijuana, which was illegal for recreational use under both state and federal law. (Ironically, New Hampshire’s cannabis decriminalization law took effect just weeks later.) But the U.S. attorney for New Hampshire does not, as a policy, bring charges for such tiny amounts of cannabis. So CBP reached out to state law enforcement about their checkpoint and asked if it could handle the drug cases.

The Woodstock police happily complied, stationing officers at the checkpoint so that CBP could hand them any drugs. Ultimately, CBP found narcotics (mostly cannabis) on several dozen people, which they promptly turned over to the Woodstock police. State prosecutors charged most of them with marijuana possession; 16 decided to fight the charges with the help of the New Hampshire ACLU. (Fifteen showed up on Thursday, packed into the courtroom across from the CBP agents who searched their cars.)

These defendants do not deny that they were carrying marijuana. Instead, they argue that the prosecutors cannot legally introduce their weed into evidence. The New Hampshire Constitution provides significantly more robust privacy protections than the United States Constitution. And while the Fourth Amendment permits suspicionless canine searches at police checkpoints, the New Hampshire Constitution flatly forbids them. So prosecutors are bringing charges in state court based on evidence that was illegally seized under state law.

Typically, when New Hampshire police officers seize contraband during an unconstitutional search, courts suppress the evidence. And that’s what the New Hampshire ACLU asked Judge Thomas Rappa of the Plymouth District Court to do. But the state has fought back, arguing that because the evidence itself was procured legally by federal agents under federal law, it can be introduced in court. Thursday’s hearing, which nearly all of the defendants attended, revolved around the admissibility of their marijuana under the state constitution.

It shouldn’t be a difficult question. The New Hampshire Supreme Court has ruled that state courts must evaluate prosecutions under the state constitution and has applied its provisions to the conduct of federal agents in the past. But Gabriel Nizetic, who represents the Plymouth Police Department, argues that applying the New Hampshire Constitution to these searches would be unfair. Nizetic asserts that because Plymouth officers conducted no searches themselves, Rappa should not apply the state constitution to the evidence that CBP agents turned over to them.

That theory only succeeds if Plymouth officers did not actually participate at all in the CBP searches. And so Gilles Bissonnette, legal director of the New Hampshire ACLU, and renowned criminal defense attorney Mark Sisti spent most of Thursday’s three-hour hearing proving that Plymouth officers were in on the game. To do so, Bissonette and Sisti called as witnesses a gaggle of CBP officers who staffed last August’s checkpoint. First up was Benjamin Labaff, who quickly acknowledged that the local police were there to collect evidence.

“Why was the Woodstock Police Department at your checkpoint?” Sisti asked.

“They were there to take the marijuana that was seized,” he responded.

“So you pointed it out, and they’d grab it?” Sisti said.

“I’d hand it over to the Woodstock Police Department,” Labaff confirmed.

Next up was Mark Qualter.

“Could it have been,” Sisti asked Qualter, “that the Woodstock police” seized something from the defendants?

“I don’t recall,” Qualter replied.

“So Woodstock may have been involved in actual searches of motor vehicles,” Sisti said.

“It’s entirely possible,” Qualter responded.

Sisti asked Qualter if he had any recollection of the searches that he allegedly conducted himself. He did not. In fact, he had no memory of ever seizing the marijuana. Sisti grinned.

Sisti’s questioning effectively revealed that Woodstock and CBP collaborated to make an end-run around the New Hampshire Constitution.

“You didn’t seize that,” he told Qualter. “Woodstock seized that. You don’t remember questioning or searching” these defendants, Sisti continued, “yet they stand charged with possession in this courtroom.”

Finally, Border Patrol Agent John Marquissee took the stand. He immediately conceded that at least one Woodstock police officer actually worked with CBP agents to help run the checkpoint.

“He took on the role of a Border Patrol agent,” Sisti responded. “He assisted the border police,” while other Woodstock officers “were there to receive the materials that you found in automobiles” and “turned over without question.”

Sisti’s questioning effectively revealed that Woodstock and CBP collaborated to make an end-run around the New Hampshire Constitution. (Both sides decided not to question several more CBP agents set to testify.) But in truth, New Hampshire law enforcement wasn’t very subtle about its goal to begin with. Woodstock Police Chief Ryan Oleson boasted to the New Hampshire Union Leader that CBP has “a lot more leeway” to conduct searches, noting that he himself could not subject drivers to a dog sniff without reasonable suspicion of a crime. In a press release, the Woodstock Police Department declared, “Woodstock Police Department was proud to assist Border Patrol with their federal checkpoint.” And in an email obtained by the ACLU, CBP reached out to the state for the express purpose of asking whether Woodstock police would be interested in arresting drivers for drug possession.

At the end of the hearing, Bissonnette delivered a rousing defense of New Hampshire’s right to protect individuals within its borders. “What this case is about,” he told the judge, “is the integrity of the New Hampshire Constitution.” Bissonnette pointed out that all of the state is within 100 miles of a border, allowing CBP to conduct checkpoints anywhere. “The state’s position would neuter the New Hampshire Constitution,” he said. “CBP would have carte blanche … to conduct warrantless, suspicionless searches through New Hampshire.”

Bissonnette is right, of course—but this case is about more than that. Last August’s checkpoint was part of the Trump administration’s clampdown on both low-level drug offenses, especially marijuana, and undocumented immigrants. The president has encouraged federal agencies to step up immigration enforcement, ensnaring thousands of people in “roundups” across the country. Some states, like California and Massachusetts, have pushed back against these dragnets in order to defend their residents’ rights. Thus far, New Hampshire has not.

That may soon change. The state cannot bar federal officers from enforcing federal law within its borders. But its judiciary can prevent local police from colluding with these agents in contravention of state law. In the Trump era, it’s up to the states to protect those civil liberties that the federal government is suddenly eager to violate. This case forces Judge Rappa to decide whether New Hampshire police can collude with federal officers to escape the constraints of the New Hampshire Constitution. But more fundamentally, it requires the judge to determine whether the state will enable an agenda that is anathema to its own founding principles.