A judge ordered Robert Gordon of the Seneca Nation of Indians to stop selling untaxed cigarettes in response to city allegations that he violated various tobacco regulations through his “All of Our Butts” company on the Allegheny Reservation in Salamanca.

The city claims that “All of Our Butts” has sold thousands of cartons of contraband cigarettes since 2002, and Manhattan federal Judge Jesse Furman cited admissions by Gordon and his wife, Marcia, that they sold more than 50 cartons of cigarettes without tax stamps to customers in the Big Apple in May 2012.

Furman rejected arguments that the Gordons are protected by “Native American sovereignty” and that the city is “attempting to require them to stamp cigarettes manufactured by Native Americans and sold by a Native American to other Native Americans.”

“The city is doing no such thing. Instead, it is merely enforcing its tax on cigarettes sold to city residents,” Furman wrote.

“The law is clear that, while states (and cities) may not tax cigarettes sold to Native Americans on Native American reservations, they may tax cigarettes sold by Native Americans to non-Native American consumers.”

New York’s combined state and city taxes on cigarettes — which exceed $50 per carton — are the highest in the nation, and the city claims an investigator bought two cartons of “Seneca Menthol Kings” from “All of Our Butts” through its Web site for just $29.20 each.

Furman also said that Marcia Gordon, who manages the daily operations of “All of Our Butts,” can’t claim exemption from the federal Contraband Cigarette Trafficking Act under a legal provision that bars its enforcement against “an Indian tribe or an Indian in Indian country.”

Furman noted that because Marcia Gordon, who isn’t a member of the Seneca Nation, “is not herself an Indian in Indian country, she — under the plain text of the Act — can be sued for its violation.”

The Gordons’ lawyers quit the case in March after telling Furman that “All of Our Butts” had gone out of business owing them “a substantial amount in legal fees.”

But Furman noted he hasn’t received an affidavit from the Gordons “or any other evidence regarding the business’s closure.”

Robert Gordon declined to comment when reached by phone yesterday, telling The Post: “You guys have no business on the reservation at all.”

In addition to ruling against the Gordons, Furman ordered the shipping company they used, Regional Parcel Services of Buffalo, to stop transporting cigarettes without tax stamps.

City Corporation Counsel Michael Cardozo praised the landmark decision as the first of its kind, and represented “an especially important success in the legal battle against untaxed cigarettes.”

“This new legal remedy efficiently targets a choke-point in the flow of untaxed cigarettes that harm our city’s public and fiscal health, and we’ll aggressively make use of it,” Cardozo added.

Earlier this year, FedEx Ground paid the city $2.4 million to settle similar allegations to those against RPS.