Love wins. Even for immigrants.

On Tuesday, a federal district court struck down a Louisiana state law denying marriage equality to foreign-born residents. The law, which I first wrote about last October, required anyone wishing to get hitched to produce a birth certificate as well as an unexpired passport or visa before receiving a marriage license. People born in the United States were allowed to get a waiver from a judge if for some reason they didn’t have a birth certificate; people born abroad were given no such option.

Ostensibly the point of this law was to prevent bigamy and other types of “marriage fraud” — and also, somehow, to thwart crafty terrorists.

“We don’t want terrorists obtaining green cards and citizenship through marriage and I believe my constituents would agree with me,” the legislation’s sponsor, State Rep. Valarie Hodges (R), told a local radio station when the law went into effect in January 2016.

Whatever the law’s purported justification, there was one especially vulnerable population that was hurt by it: refugees.

Louisiana has a decent-sized refugee population, including many who fled Laos and Vietnam during the Vietnam War. Despite being here legally — and in many cases, having ultimately received U.S. citizenship — these Louisianans often were never issued birth certificates.

This prevented couples such as Laotian-born refugee Out Xanamane and his long-time partner, U.S.-born Marilyn Cheng, from getting married in the state where they lived. This couple had undergone a Buddhist religious marriage ceremony in 1997 but never filed paperwork with the state. After Xanamane was diagnosed with liver cancer in 2016, he desperately needed a legally-recognized marriage certificate to qualify for Cheng’s employer-sponsored health insurance plan. When they were turned away by multiple parish clerks in Louisiana, the couple and their kids ultimately drove to Alabama and got married there instead.

Other immigrants who were turned away by Louisiana parish clerks simply gave up. One, Viet “Victor” Anh Vo, a naturalized U.S. citizen born in an Indonesian refugee camp to Vietnamese parents, sued.

Because it turns out that in addition to being heartless and not very family-values-minded, the law was also unconstitutional.

“The court recognized that Louisiana had a two-tiered system, between those born outside of the country and those born inside the country,” said Alvaro Huerta, a staff attorney for the National Immigration Law Center who represents Vo.

Tuesday’s ruling was based on the equal protection and due process clauses, which do not distinguish between people of different immigration status, the court said. In the most recent legislative session, state lawmakers had applied some fixes to the marriage law, but the new bill did not address all the constitutional problems relating to immigration status.

Vo and his U.S.-born significant other, Heather Pham, convinced a Catholic priest to officiate at their religious marriage ceremony last year even after they found out they could not get a state-issued license. (The planned wedding was two weeks away at the time, and they didn’t want to cancel on all their guests and vendors.) And while a judge issued a preliminary injunction against the law in March, thereby allowing the couple to finally obtain a legal marriage license, they decided to hold off until a ruling on the merits that vindicated all Louisianan immigrants’ marriage rights. The happy couple expects to re-apply for a state-issued marriage license soon, according to their lawyer.

Also cheering the ruling is Out Xanamane’s cousin, Phanat Xanamane, born in a Thai refugee camp to Laotian parents and now a naturalized U.S. citizen.

“I feel that justice was upheld today,” Phanat, who is not married, wrote me.

This is actually not the first time a federal court needed to step in and affirm Phanat’s constitutional right to wed; Phanat is gay, and almost exactly two years ago he celebrated when the Supreme Court ruled that same-sex marriage was the law of the land.

Tuesday’s ruling, he says, “shows you how easily you can have your rights ripped away if you’re not paying attention to lawmakers.”