A long-standing immigration law making it easier for a child born out of wedlock overseas to become a U.S. citizen if the child's mother is a citizen is unconstitutional sex discrimination, a federal appeals court has ruled.

The law, passed during the Korean War, applies to children born abroad to one U.S. citizen parent and one foreign parent who are not married.

If the mother is a U.S. citizen, the child is automatically a U.S. citizen provided the mother has lived in the United States continuously for a year.

If the father is a U.S. citizen, additional requirements apply: The father must agree in writing to support the child until age 18, and paternity must be established by marriage, a sworn acknowledgment by the father or a court finding.

The law relies on "outdated stereotypes . . . the generalization that mothers are more likely to have close ties to and care for their children than are fathers," said the opinion written by Judge Mary Schroeder and issued Thursday. She said the law also "presumes that a father will not care for and support his child unless required to do so."

Judge Arthur Alarcon agreed, but Judge Andrew Kleinfeld dissented, saying the majority had misunderstood the Supreme Court ruling. He also said the law had a "rational purpose" that "may not be pretty" but should not be questioned by courts: to limit the citizenship claims of children fathered by U.S. soldiers in Korea.

The ruling overturned the conviction of Ricardo Ahumada-Aguilar, Mexican-born son of a Mexican mother and a U.S. citizen father. Ahumada became a legal U.S. resident in California at 13, after his mother married a U.S. citizen, but he was deported seven years later after a cocaine conviction.

He reentered the country twice and was charged in Seattle in 1995 with the crime of illegal entry after deportation. A judge rejected his claim of citizenship and sentenced him to a year and three months in prison.