Government rules allowing faith schools to refuse to have homosexual teachers on their staff are to be challenged in court.
The National Union of Teachers (NUT) said it was to seek a judicial review of the regulations, which implement an EU directive, as it believed they broke both European law and the 1998 Human Rights Act.
NUT general secretary Doug McAvoy said a teacher's sexual orientation was irrelevant to his or her ability to do the job.
The EU directive states an employer could discriminate on the grounds of sexuality or religious belief if it was a "genuine and determining occupational requirement, provided that the objective is legitimate and the requirement is proportionate".
But Mr McAvoy said: "We cannot accept that committed teachers should be discriminated against because of their sexual orientation.
"Teachers are professionals working to the utmost of their talents for the benefit of their pupils.
"Their sexual orientation has nothing to do with their capacity to teach or the performance of their duties.
"Governing bodies should not be given special dispensation to sack good teachers simply on the grounds of their sexual orientation."
A Department of Trade and Industry spokeswoman said: "I think it would be extremely hard to sustain the argument that a teaching job in a faith school exists for the purposes of organised religion, since teachers are employed for the purposes of education.
"It would be unlawful for governing bodies to sack good teachers simply on the grounds of their sexual orientation, as the NUT claims."