Justice Ruth Bader Ginsburg (J. Scott Applewhite/AP)

Justice Ruth Bader Ginsburg relied in part on gender equality cases she brought as a pioneering civil rights lawyer as the Supreme Court on Monday struck down a law that treats unwed mothers and fathers differently when granting citizenship to their children born abroad.

The law imposed different standards for acquiring citizenship for the offspring of an unwed U.S. citizen who has a child with a citizen of another nation. Fathers had to meet a longer requirement of physical presence in the United States than did mothers.

Ginsburg, writing for five other justices, said the different requirements “date from an era when the lawbooks of our Nation were rife with overbroad generalizations about the way men and women are.”

That unwed mothers had to meet a lesser requirement than married couples or unwed fathers, Ginsburg added, reflected that decades ago, “two once habitual, but now untenable, assumptions pervaded our Nation’s citizenship laws and underpinned judicial and administrative rulings: In marriage, husband is dominant, wife subordinate; unwed mother is the natural and sole guardian of a nonmarital child.”

But the court said the remedy was not to make it easier on children of unwed fathers, but harder on children of unwed mothers.

In the decision, Ginsburg cited a long list of cases she had a hand in — either as a lawyer arguing before the court or as a justice — striking down laws that treated men and women differently in, for instance, receiving Social Security survivor benefits or being admitted to the Virginia Military Institute.

“Successful defense of legislation that differentiates on the basis of gender, we have reiterated, requires an ‘exceedingly persuasive justification,’ ” Ginsburg wrote, quoting her own opinion in U.S. v. Virginia.

She dismissed the government’s argument that the different treatment was logical because only the mother is the legally recognized parent at birth and that the government was trying to avoid situations in which a child would be born “stateless.”

The case at the court involved Luis Ramon Morales-Santana, who was brought to Puerto Rico at age 13 after being born in the Dominican Republic to an unwed U.S. citizen father and a Dominican mother (they later married). By 1976, he was living in New York.

In 2000, when the government tried to deport him after convictions for robbery and attempted murder in 1995, Morales-Santana claimed he should be considered a citizen.

Under the law, a child born outside the United States to an unwed citizen father and a noncitizen mother can become a U.S. citizen if the father lived in the United States for five years, with at least two of those years coming after the age of 14. But Morales-Santana’s father missed that requirement by just a few weeks.

The requirement for an unwed American mother is that she must have lived in the United States continuously for one year before giving birth.

A federal appeals court ruled for Morales-Santana, saying the same rules must apply to both unwed fathers and mothers, and Morales-Santana met the more lenient one-year rule.

Ginsburg said the U.S. Court of Appeals for the 2nd Circuit was only half-right.

The discriminatory rules must fall, she said. But the prospective remedy is that children of unwed mothers have to meet the tougher standard, not that the children of unwed fathers get the more lenient one, she said.

That means Morales-Santana won the battle but lost the war and still will not get his citizenship.

“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.

Chief Justice John G. Roberts Jr. and Justices Anthony M. Kennedy, Stephen G. Breyer, Sonia Sotomayor and Elena Kagan joined Ginsburg’s opinion. Justice Neil M. Gorsuch was not on the court when the case was argued, and took no part in the decision.

Justices Clarence Thomas and Samuel A. Alito Jr. did not join Ginsburg’s reasoning and agreed only in overturning the 2nd Circuit’s relief to Morales-Santana.

The case is Sessions v. Morales-Santana.

Correction: An earlier version of this story misstated the name of Virginia Military Institute. It has been corrected.