A federal appeals court in Philadelphia ruled Monday that Muslim women employed at the Delaware County prison may not wear religious head scarves at work.

In a 2-1 decision, the U.S. Court of Appeals for the Third Circuit upheld a lower-court ruling in favor of the prison, saying any deviation in the prison dress code would cause "hardship by compromising its institutional security and safety."

The majority opinion agreed with prison officials who argued the scarves could be taken by an inmate and used to choke someone. Prison officials have legitimate concerns the head scarves could also hide drugs or other contraband, the majority said.

In 2005 the GEO Group, a Florida-based company hired by the county to run the prison, required that all employees wear only the official uniform.

The U.S. Equal Employment Opportunity Commission filed a suit in 2007 on behalf of three women, all hired before the new policy was adopted, alleging religious discrimination for not making exceptions to the dress code. The three wore Muslim head coverings, called khimars, while working.

One of the women, Carmen Sharpe-Allen, a nurse, was fired for refusing to remove her head scarf. The other two women, Marquita King, an intake clerk, and Rashemma Moss, a correctional officer, stopped wearing the scarves while at work, according to the ruling.

U.S. District Judge John P. Fullam had dismissed the EEOC lawsuit, and two of the three judges on the appeals panel agreed with him. They said it was a close call, but the prison's need for order trumped the women's right to wear the religious attire at work.

"The EEOC has an enviable history of taking steps to enforce the prohibition against religious discrimination in many forms," Third Circuit Judge Dolores K. Sloviter wrote. "On the other hand . . . a prison is not a summer camp and prison officials have the unenviable task of preserving order in difficult circumstances."

An EEOC spokeswoman said the agency was disappointed by the decision and was reviewing its options. Lawyer Walter F. Kawalec III, who argued the case for the GEO Group, did not immediately return a call for comment.

In his dissent, Judge A. Wallace Tashima said the GEO Group had not been made to prove that the use of head scarves by employees posed an undue burden.