The state’s highest court has toppled a cultural taboo — legalizing a degree of incest, at least between an uncle and niece — in a unanimous ruling.

While the laws against “parent-child and brother-sister marriages . . . are grounded in the almost universal horror with which such marriages are viewed . . . there is no comparably strong objection to uncle-niece marriages,” Tuesday’s ruling reads.

Judge Robert Smith of the Court of Appeals wrote that such unions were lawful in New York until 1893 and Rhode Island allows them.

The decision stems from a case brought by Vietnamese citizen Huyen Nguyen, 34, a woman who had appealed a ruling by an immigration judge.

The judge had tried to boot her from the United States after declaring that her 2000 marriage in Rochester to her mother’s half-brother was invalid.

Nguyen and her husband, Vu Truong, 38, appealed and won.

“I’m very happy for my clients,” said their lawyer, Michael Marszalkowski.

“They’ve been married 14 years now, but unfortunately, for half the time, there has been this concern over their heads about whether [the immigration issue] could be resolved. Thankfully, now it has been,” Marszalkowski said.

Marszalkowski said he won the case by zeroing in on the language of the state’s domestic-relations law.

The statute reads that “a marriage is incestuous and void whether the relatives are legitimate or illegitimate between either: 1. An ancestor and a descendant; 2. A brother and sister of either the whole or half blood; 3. An uncle and niece or an aunt and nephew.”

Incest is a crime punishable by a $50 to $100 fine and up to six months in jail.

Marszalkowski determined that as a matter of consanguinity, or blood relations, half-uncles and nieces share the same level of genetic ties as first cousins — or only one-eighth the same DNA.

“It really was the equivalent of cousins marrying, which has been allowed in New York state for well over 100 years,” Marszalkowski said.

Those on the six-person judicial panel acknowledged that they are not scientists, but noted that the “genetic risk in a half-uncle, half-niece relationship is half what it would be if the parties were related by the full blood.”

Nguyen and her husband, a truck driver, still live in Rochester and do not have any children.

She sued the US Attorney General Eric Holder, who enforces the country’s immigration laws.

A spokesman from his office did not return a message.

Family law expert Michael Stutman of the firm Mishcon de Reya, who is not involved in the case, said the ruling is in synch with today’s modern families.

“As people are more mobile and living longer marriages are ending and people remarry and you get blended families with step children and half children,” Stutman reasoned.

“There are plenty of other societies that allow so-called intermarriage without worrying about genetic defects. And frankly we have a long history of cousins marrying each other, take FDR and Eleanor Roosevelt,” he said.

The president and his wife were fifth cousins once removed.