JACKSONVILLE, Fla. – Joyce Quiller was saved by her teachers union contract.

The 51-year-old foul-mouthed math teacher was terminated by the Duval County School Board in February 2014 after she allegedly called one student the N-word, and regularly cursed out others in her class at Jean Ribault High School in Jacksonville.

MORE NEWS: VIDEO: Throng of illegals waits to be rafted across Rio Grande

A judge ruled in July 2014 that her misconduct was a relatively minor offense, and school officials jumped the gun by terminating the teacher without following every step in her teachers union contract, the Daily Mail reports.

Duval County school officials appealed the judge’s decision, but the July decision was upheld by the First District Court of Appeal Wednesday in a ruling that also forces the school district to reinstate Quiller, according to News4Jax.com.

“The court found that, under the terms of the contract, Quiller should have been suspended without pay before being terminated unless it was a severe act of misconduct, which the court ruled the use of inappropriate language was not severe misconduct,” the news site reports.

The school district’s contract with the Duval County Teachers’ Union spells out a “progressive discipline policy” that starts with a verbal reprimand on a first offense, then moves to a written reprimand for repeat behavior. If a teacher doesn’t correct course the district is required to issue a paid suspension before terminating a misbehaving employee.

Media reports show Quiller was reprimanded on at least three occasions since 2001, most recently in 2014. In a January 2014 complaint, a student told officials Quiller said “You are all some lazy n—– for coming to class late,” WJXT reported last fall.

Quiller denied making the racist remark.

MORE NEWS: VIDEO: Ron Paul appears to suffer ‘stroke’ during livestream

Another student told officials he forgot to bring a pencil to class and incited his teacher’s wrath. Quiller allegedly asked the student: “What is the point of coming to the mother f—— class if you do not bring materials?”

Quiller also allegedly called student “stupid” and “ignorant” and cursed in class, according to the Daily Mail.

The court ruling issued this week notes that the school board “was required to follow progressive steps in administering discipline unless a severe act of misconduct warranted circumventing the steps.

“The (administrative law judge) found that using profanity in front of students was not a severe act of misconduct. The Board adopted this conclusion of law. As such, the Board’s rejection of the (administrative law judge’s) recommendation was not in compliance with the collective bargaining agreement.”

In the earlier ruling, an administrative law judge reviewing the case ruled that Quiller should have been suspended with pay instead of terminated.

“The Appellant argues that the Board erred in rejecting the administrative law judge’s recommendation that the board follow the disciplinary process agreed to in the collective bargaining agreement …,” the appeals ruling read. “We agree.”

In other words, Quiller repeatedly cursed at students, and although an administrative law judge agreed that was inappropriate, the judge didn’t think it was a fireable offense and ordered Quiller reinstated and suspended.

The school district ignored that demand, and appealed the judge’s decision, but the appeal court sided with the administrative law judge and ordered district officials to reinstate Quiller.

Quiller’s attorney told News4Jax the 21-year educator is eager to get back to work, though the Daily Mail reports she may already be working at the private Potter’s House Christian Academy