WASHINGTON (AP) — The Supreme Court on Wednesday limited when people can sue federal officials for a violation of their rights, siding with the government in a case involving the owner of a notorious inn on the U.S.-Canada border.

The justices said that the owner of the Smuggler's Inn, Robert Boule, can't sue a Border Patrol agent over a confrontation at his inn where he said the agent shoved him and then retaliated against him when he complained that the man had used excessive force. It's the latest in a line of cases narrowing the public's ability to sue federal officials for rights violations.

“Congress is better positioned to create remedies in the border-security context, and the Government already has provided alternative remedies that protect plaintiffs like Boule," Justice Clarence Thomas wrote.

Thomas wrote that the court's “cases have made clear that, in all but the most unusual circumstances," creating the ability to sue “is a job for Congress.”

The high court said in 1971 that people could sue federal officials for violating their constitutional rights. But over the last 40 years the court has consistently declined to expand the kinds of cases, called Bivens actions after the 1971 case, in which a person could sue. Most recently, in a case in 2020, the justices told parents of a teenager killed in Mexico by a U.S. Border Patrol agent who fired across the border that they couldn't sue. Thomas said the original 1971 case would likely come out differently today but that the current case didn't require the court to reconsider it.

All nine of the court’s justices agreed that Boule shouldn’t be able to pursue his retaliation claims, but the court's three liberal justices said he should have been able to pursue his excessive force claims, saying the facts of the case were very similar to the case the court decided in 1971.

Justice Sonia Sotomayor wrote for the court's liberal justices that the majority's decision “contravenes precedent and will strip many more individuals who suffer injuries at the hands of other federal officers ... of an important remedy.” Referring to the court's conservative majority, strengthened to six under the Trump administration, Sotomayor said that "a restless and newly constituted Court sees fit to refashion the standard anew to foreclose remedies in yet more cases."

In a tweet, Athul Acharya, the executive director of the group Public Accountability, said the “short version” of the case is: “Federal agents can violate nearly any constitutional right with impunity and you have no recourse.”

Greg Boos, a lawyer for Boule, called the decision a “hatchet job” that he said was full of factual misrepresentations and distortions that are “incredibly disappointing.” “This leaves us without any protection from the Border Patrol as far as our constitutional rights go,” Boos said.

The setting of the case before the justices was unique. Officials have said the Smuggler's Inn in Blaine, Washington, is a magnet for illegal border crossings and a place where drugs have been seized. Boule's property actually extends into Canada and a line of rocks on the property marks the international boundary. There is no fence. Thomas inserted a picture of the boundary stones in the opinion to show how easily a person can cross the U.S.-Canada border at the property.

Rooms at the inn are named after famous smugglers and other notorious individuals, and a black SUV used by the inn to transport customers to the property has the personalized license plate “SMUGLER.” Boule makes money by picking up guests who sometimes travel long distances and charging them for lodging, “even if they never intended to stay," Thomas said. He described the property's amenities by inserting a photo of bunk beds in one room. Boule's lawyer said that room is used to house soccer players who stay at the property when traveling for tournaments and emailed reviews praising the inn.

Boule has also served as a confidential informant for the U.S. government, and parts of documents filed in the high court case were redacted. Boule's lawyers have said he has a “longstanding cooperative relationship with the U.S. government" and has alerted officials to people of interest.

In March 2014, Boule told Border Patrol agent Erik Egbert that a guest arriving at the inn was from Turkey. Egbert has said he was suspicious that the guest would travel over 7,500 miles to stay at “a rundown bed-and-breakfast,” and when the guest arrived, he went to the property to investigate. Boule asked him to leave, but Egbert allegedly threw him to the ground, injuring him. After determining the guest was legally in the country, Egbert left. The guest ultimately crossed into Canada illegally the same night.

Boule notified Egbert’s supervisors and filed an administrative claim about the rough treatment, and Boule says Egbert retaliated by making reports about him and his business to various state and federal agencies including the Internal Revenue Service. But no agency found Boule did anything wrong. Thomas wrote that after a year-long investigation, the Border Patrol took no action against Egbert. A document filed in the case shows the investigation concluded Egbert's removal from his position was warranted because he wasn't forthcoming with investigators. But Egbert continues to work for the Border Patrol, Boule’s lawyer said.

Boule sued, saying Egbert had violated his Fourth Amendment rights by using excessive force and his First Amendment rights by retaliating against him. A federal trial court ruled for Egbert, but an appeals court reversed the decision and Egbert appealed to the Supreme Court.

The Associated Press was one of nearly three dozen media organizations that joined a brief urging the justices to side with Boule, arguing that the ability of journalists to sue federal officials for damages over First Amendment violations is important to press freedom.

The case is Egpert v. Boule, 21-147.

Copyright 2022 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.