The U.S. Supreme Court decided that federal citizenship rules violate the Constitution by making it harder for some foreign-born children of American men to become citizens than children born abroad to American women.

The court, however, said it wouldn’t confer citizenship on the man who challenged the policy. The justices instead made it harder for the future offspring of American women to become citizens.

The decision came in the case of Luis Ramon Morales-Santana, a man born in the Dominican Republic who is facing deportation after being convicted of a 1995 robbery and attempted murder in New York.

Under federal law, a child born abroad to an unmarried American mother and non-American father could claim U.S. citizenship if the mother lived continuously in the U.S. for a year at some point before the birth. If the father is American and the mother isn’t, the residency requirements are more stringent, currently requiring the father to have spent five years in the U.S.

The Supreme Court Monday said the distinction amounted to discrimination on the basis of gender, violating the Constitution’s equal protection clause. Writing for six of the eight participating justices, Justice Ruth Bader Ginsburg said the differing requirements were "stunningly anachronistic."

Ginsburg, however, rejected the appeals court’s decision to let Morales-Santana, born in 1962 to a Dominican mother and a American father, invoke the more lenient rules.

She said federal law indicated Congress would have preferred to fix the discrepancy by instead applying the longer residency period to the children of American mothers.

"Going forward, Congress may address the issue and settle on a uniform prescription that neither favors nor disadvantages any person on the basis of gender," Ginsburg wrote. In the meantime, the five-year requirement "should apply, prospectively, to children born to unwed U.S.-citizen mothers."

Justices Clarence Thomas and Samuel Alito said they wouldn’t have decided the equal protection issue and would have simply said Morales-Santana couldn’t claim citizenship. Justice Neil Gorsuch didn’t participate in the case, which was argued before he joined the court.