(CNN) The Supreme Court ruled in favor of a Muslim woman who has sued retailer Abercrombie & Fitch when the store failed to hire her because she wore a head scarf in observance of her religion.

The court ruled 8-1 that the company failed to accommodate Samantha Elauf's religious needs when she was not hired on the basis that her hijab violated company dress policy. Justice Clarence Thomas dissented with part of the ruling but concurred with the rest.

Abercrombie & Fitch argued that Elauf couldn't succeed without first showing that the employer had "actual knowledge" of her need for a religious accommodation. But the Court disagreed, and sent the case back down to the lower court for further consideration.

"An applicant need show only that his need for an accommodation was a motivating factor in the employer's decision, not that the employer had knowledge of his need," Justice Antonin Scalia wrote for the majority.

The case was being closely watched by other retailers with so called "look policies" as well as religious liberty groups who believe that an employee shouldn't have to explain their religious justification if the employer already has reason to know it.

"The significance of today's ruling is that an employer cannot put its head in the sand when it has reason to believe that an applicant will need a religious accommodation," said Gregory Lipper of Americans United for Separation of Church and State, who joined a brief in favor of Elauf.

"It means that if an employer thinks a potential employee needs a religious accommodation, than the employer needs to make a reasonable effort to accommodate; it can't reject the applicant and then plead ignorance, " he said.

The controversy began in 2008 when then 17-year-old Samantah Elauf sought a job with the retailer. Prior to the interview, Elauf was nervous she might not be hired because of the black headscarf that she wears for religious reasons. She interviewed with assistant manager Heather Cooke, however, and although she was told that the company's "look policy" meant she shouldn't wear a lot of make up, black clothing or nail polish, her head scarf never came up.

JUST WATCHED An argument for same-sex marriage Replay More Videos ... MUST WATCH An argument for same-sex marriage 01:54

But after the interview Cooke sought approval from her district manager. She said she told the manager that she assumed Elauf was Muslim and figured she wore the head scarf for religious reasons. The manager said Elauf shouldn't be hired because the scarf was inconsistent with the look policy that bans head gear.

A federal agency, the Equal Employment Opportunity Commission sued on Elauf's behalf. After arguments, P. David Lopez, EEOC General Counsel issued a statement saying," Monday's case is the latest effort to ensure all persons protected by Title VII are not placed in the difficult position of choosing between adherence to one's faith and a job."

In Court lawyers for the government argued that it was not Elauf's obligation to give direct notice that she needed an accommodation.

Photos: The many signs of #SCOTUS Outside the Supreme Court of the United States, people hold signs calling for "equal justice under law." Hide Caption 1 of 14 Photos: The many signs of #SCOTUS A group against same-sex marriage prays in an "appeal to heaven" outside the Supreme Court. Hide Caption 2 of 14 Photos: The many signs of #SCOTUS Catherine Quinn of Detroit holds up her sign supporting same-sex marriage outside the Supreme Court. Hide Caption 3 of 14 Photos: The many signs of #SCOTUS Pastor Larry Hickam holds a sign of what he says is the definition of marriage outside the Supreme Court. Hide Caption 4 of 14 Photos: The many signs of #SCOTUS Kevin Rosseel of Washington stands outside the Supreme Court with his sign in support of same-sex marriage. Hide Caption 5 of 14 Photos: The many signs of #SCOTUS Stephanie Jones and Diana Iwanski of Clermont, Florida, share their sign in support of same-sex marriage outside the Supreme Court. Hide Caption 6 of 14 Photos: The many signs of #SCOTUS Sarah Rauber of Maryland stands in front of the Supreme Court. Hide Caption 7 of 14 Photos: The many signs of #SCOTUS McKenna Inskeep hands out stickers in support of marriage equality outside the Supreme Court. Hide Caption 8 of 14 Photos: The many signs of #SCOTUS Mike May of Cleveland argues against same-sex marriage in a debate outside the Supreme Court. Hide Caption 9 of 14 Photos: The many signs of #SCOTUS Outside the Supreme Court, John Lewis and Stuart Gaffney of San Francisco hold signs celebrating their marriage. Hide Caption 10 of 14 Photos: The many signs of #SCOTUS Senior Novice Sister Sedusa Poly Tishun shows off her face paint outside the Supreme Court. "We're here raising up our voices and our glitter in shouts of joy in support of marriage equality," Tishun said. Hide Caption 11 of 14 Photos: The many signs of #SCOTUS Andrew Damron of Brooklyn, New York, holds up a sign with the motto "You Only Live Once" in support of same-sex marriage. Hide Caption 12 of 14 Photos: The many signs of #SCOTUS Andrew Zibell of Brooklyn, New York, holds a sign in front of the Supreme Court that shows his support of same-sex marriage. Hide Caption 13 of 14 Photos: The many signs of #SCOTUS Senior Novice Sisters Ray Deeo Active and Allie Lewya show off their face paint in support of same-sex marriage. Hide Caption 14 of 14

"Knowledge of the need for an accommodation requires an understanding not simply of an applicant's religious practices but also of company policies," wrote Solicitor General Donald B. Verrilli Jr. in court papers. "The employer almost uniformly has knowledge of the latter," he said.

But lawyers for Abercrombie countered that over the years applicants have requested accommodations and the company has granted them.

"Here, Elauf never identified her headscarf as religious, nor did Abercrombie have actual knowledge of that fact from any other source," wrote Shay Dvoretzky, a lawyer for the retailer. In Court he argued, "What we want to avoid is a rule that leads employers, in order to avoid liability, to start stereotyping about whether they think, guess or suspect that somebody is doing something for religious regions."