The U.S. Border Patrol has agreed in a legal settlement to not set up interior checkpoints in a northern New Hampshire town just under 100 miles from the Canadian border before Jan. 1, 2025.

The agreement announced Friday settled a 2020 lawsuit over the use of the checkpoints in Woodstock, where the American Civil Liberties Union claimed that border agents conducted illegal searches and seizures that led to the arrest of American citizens for violating state drug laws that had nothing to do with immigration.

"Border Patrol’s interior checkpoint operations are unlawful and invasive, and this settlement means the people of northern New England will continue to be free from these unconstitutional searches and seizures in Woodstock until January 1, 2025," Gilles Bissonnette, the legal director of the ACLU of New Hampshire, said in a news release.

US BORDER PATROL TRANSFERS AGENTS TO CANADIAN BORDER AMID MIGRANT CRISIS

The lawsuit arose from a 2017 case in which 16 people were stopped at a checkpoint on Interstate 93 during a three-day operation that was staffed by Border Patrol officers and local police. They were charged by the state with possession of small amounts of drugs.

In the original complaint, the ACLU said that during the operation in late August 2017 no individual was charged with having unlawfully crossed the border from Canada.

Two of the people apprehended at the Woodstock checkpoint sued. One of them, Jesse Drewniak, a U.S. citizen from Hudson, was returning home from a fishing trip in the White Mountains when he was arrested on a minor drug charge.

CBP badge patch

Border Patrol authorities have settled a lawsuit brought forth by the ACLU over drug busts performed at a New Hampshire interior checkpoint. (AP Photo/Eric Gay, File)

A state judge concluded that the primary purpose of the checkpoint was the detection and seizure of drugs, making it "unconstitutional under both state and federal law." Prosecutors later dismissed the charges.

The settlement announced Friday only applies to Border Patrol checkpoints in Woodstock, said Stephanie Gomory of the Vermont ACLU.

CANADIANS FRUSTRATED BY MIGRANT SURGE, ILLEGAL BORDER CROSSINGS: 'NO POLITICAL WILL TO FIX THIS'

"The ACLU of Vermont — along with our colleagues in New Hampshire and Maine — will be ready to challenge Border Patrol should they resume these unconstitutional practices in the future," she said in an email.

In a statement, U.S. Customs and Border Protection said both sides in the lawsuit reached a "mutually beneficial resolution."

The Border Patrol "remains committed to efficiently and effectively utilizing its resources to halt the entry of potential threats into the United States," the statement said.

CLICK HERE TO GET THE FOX NEWS APP

Under federal law, the Border Patrol can enforce immigration laws within 100 miles of the country's borders. Over the years the agency has set up similar checkpoints in the three northern New England states, but it hasn't done so since 2019, the ACLU said.