WASHINGTON (Reuters) - The Obama administration on Friday asked a federal appeals court to block Alabama's strict new anti-illegal immigration law after a federal judge allowed key portions to take effect.

U.S. District Judge Sharon Lovelace Blackburn earlier this week backed the law authorizing police to detain people suspected of being in the country illegally if they cannot produce proper documentation when stopped for any reason.

The judge also upheld a provision that permits the state to require public schools to determine the legal residency of children. Federal judges in other states have blocked similar state laws aimed at trying to stem illegal immigration.

The Justice Department filed an appeal with the U.S. Court of Appeals for the 11th Circuit, based in Atlanta, and also asked Blackburn to put her ruling on hold pending that appeal.

The administration argued that the U.S. Constitution made immigration a federal matter that "cannot be subject to a patchwork of state measures. Alabama thus has no authority to regulate in the area of immigration."

Several states have passed legislation to beef up laws to deter illegal immigrants, arguing that the Obama administration has not done enough to stop their flow into the country.

There are an estimated 11 million illegal immigrants in the United States.

Arizona adopted its own tough law but the Obama administration successfully sued to block it. Efforts to more broadly address illegal immigration in the U.S. Congress have gone nowhere.

Blackburn temporarily barred Alabama from making it a crime to knowingly transport or harbor an illegal immigrant or prohibiting illegal immigrants from attending its public colleges.

She also allowed provisions that bar illegal immigrants from commercial contracts with the state or local governments, applying for or renewing drivers' licenses and identification cards or seeking license plates.

(Reporting by Jeremy Pelofsky, editing by Anthony Boadle)