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

The 11 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 drivers’ 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.