Oluwatoyin Olusase, a Christian, was invigilating an Islamic religious knowledge exam at the school in Gombe state when the incident occurred.
The students attacked her outside the school compound after the exam and killed her, witnesses said. It was not clear exactly what she had done to anger her attackers.
Police confirmed the killing and said their intervention had prevented the incident from turning into a riot.
“We have received information that a female teacher has been lynched by her students. We are investigating the report,” Gombe state police commissioner Joseph Ibi said.
In February, 2006, at least five people were killed and several churches burned down in neighbouring Bauchi by Muslims infuriated that a Christian teacher in a secondary school had tried to confiscate a Koran from a student who was reading it during class.
At least 15,000 people have died in religious, communal and political violence in Nigeria since 1999, when it returned to democracy after 30 years of almost unbroken military rule.