A federal appeals court has ruled it is unconstitutional for Alabama to check the immigration status of schoolchildren when they enroll, or to require illegal immigrants to carry identification.

The 11th Circuit Court of Appeals did uphold provisions of the state immigration law that allow police to stop people they have a "reasonable suspicion" of being in the country unlawfully, and to ask about the immigration status of motorists without driver's licenses.

But the court also struck down a provision that barred residents and businesses from entering into contracts with people who are in the state illegally, the Montgomery Advertiser says. The court ruled that the intent of the provision, known as Section 27 of the state's tough immigration law, was "forcing undocumented individuals out of Alabama."

"To say that section 27 is extraordinary and unprecedented would be an understatement," the court wrote in its ruling.

Regarding immigration checks for students, the court determined that such a requirement would cause "significant interference with the children's right to education" and therefore violated the equal protection clause of the Constitution.

The ACLU, which challenged the law, welcomed the ruling.

"The court today rejected many parts of Alabama and Georgia's anti-immigrant laws, including attempts to criminalize everyday interactions with undocumented immigrants and Alabama's callous attempt to deprive some children of their constitutional right to education, " said Omar Jadwat, senior staff attorney with the ACLU Immigrants' Rights Project. "The court explicitly left the door open to further challenges against the 'show me your papers' provision, which we will continue to fight in order to protect people's constitutional rights."