WASHINGTON -- The Supreme Court struggled Wednesday with a case fundamental to the separation of church and state, testing when people who work for religious organizations can sue for job discrimination.

A Michigan teacher diagnosed with narcolepsy but eventually cleared to work sued under the Americans with Disabilities Act when a Lutheran school fired her.

The Hosanna-Tabor Evangelical Lutheran Church said Cheryl Perich violated a core church principle by bringing her grievance to the U.S. Equal Employment Opportunity Commission (EEOC) rather than using church processes to try to win her job back. Hosanna-Tabor is asking the justices to throw out the case, based on a so-called "ministerial exception," which bars some job-related lawsuits against religious organizations and is intended to protect churches from government interference. A lower U.S. appeals court had ruled for Perich.

The appeals court rejected Hosanna-Tabor's "ministerial exception" defense, noting that Perich's job as a fourth-grade teacher was mostly secular. She taught math, social studies, music and other subjects, along with religion.

In his appeal on behalf of Hosanna-Tabor, University of Virginia law professor Douglas Laycock told the justices, "Churches do not set the criteria for selecting or removing the officers of government, and government does not set the criteria for selecting and removing officers of the church."

He urged the justices to rule that any employee who is a commissioned minister or who teaches religion, irrespective of other duties, is a "minister" and barred from suing. In his written filing, Laycock asserted that while judges have long recognized a "ministerial exception" in employment litigation, determining who is covered has been difficult.

"They agree that it extends beyond pastors, priests, and rabbis, but not as far as janitors or secretaries," he said. "The question is where to draw the line."

Of Perich, Laycock said that not only did she offer religion classes, she also had been a "called" teacher with ministerial responsibility. "The fact that she's a commissioned minister is the clincher in this case," he said.

Assistant U.S. Solicitor General Leondra Kruger, representing the EEOC, urged the justices to consider the case more strictly as an employee-employer dispute, without special consideration because a church is involved.

Arguing separately on behalf of Perich, Walter Dellinger said any ministerial exception should be read narrowly. He told the justices that in most lower courts it has not applied to teachers.

The justices appeared to be frustrated with the arguments of all three lawyers and searching for some ground between extremes. There was no shortage of examples of the potential scope of the case, however.

Justice Sonia Sotomayor, for example, wondered about a teacher who reported child sexual abuse to the government and was fired because of the report.

Laycock said that was "a difficult case" and that an exception to his rule might arise when the safety of children was at issue.

Justice Anthony Kennedy, often a crucial vote on the most contentious cases, homed in the fact that Perich was claiming retaliation under disabilities law and "can't even get a hearing."

"You're asking for an exemption so these cases can't even be tried," Kennedy told Laycock.

Several justices, including Justice Samuel Alito, suggested they wanted to make sure lower court judges did not end up having to examine the validity of various religious tenets.

Many of the justices expressed surprise at the EEOC position that the case should be viewed as a general bias lawsuit. "We think the basic contours of the inquiry are not different," Kruger said, from other lawsuits that may involve an employer's message or mission.

"That's extraordinary. That's extraordinary," Scalia said, rejecting the stance that the First Amendment protection for religious freedom would not shape the case.

Chief Justice John Roberts observed to Laycock that "different churches have different ideas about who's a minister. There are some churches who think all of our adherents are ministers of our faith."

Roberts also immediately jumped at an argument from Dellinger that it matters if an employee has "important secular functions."

"That can't be the test," Roberts said. "The pope is a head of state carrying out secular functions. Those are important. So he is not a minister?"

Dozens of religious organizations and civil rights have filed competing "friend of the court" briefs in the case that pits the interest in keeping government from interfering with religion with the interest in ensuring that workers' claiming race, sex, or — as here, disability — bias, can get into court.

A ruling in the case of Hosanna-Tabor Evangelical Lutheran Church and School v. Equal Employment Opportunity Commission is likely by next summer.