Academic tenure was put in place in U.S. school systems in the first half of the 20th century to protect teachers from arbitrary punishment, but in the last several decades it has morphed into something else altogether.

Typically earned after four or five years, tenure protects teachers from being fired without just cause. But when combined with the ability of teachers unions to fight tooth and nail over any accusation leveled against a protected teacher, tenure can keep bad teachers in the classroom or at least on the payroll for decades after initial charges.

Below are a dozen cases in which tenure and union muscle protected bad teachers, often at the expense of students:

Matthew Lang was a band director at O’Fallon Township High School in Illinois in 2007 when administrators learned he was having a sexual relationship with a 17-year-old female student. But instead of being fired, Lang was able to resign, and the relationship was kept out of his file so he could seek another teaching job.

“… we are asking that all information concerning the request for his resignation not be placed in his file,” read a letter from the teacher’s union rep to the O’Fallon school board that was originally obtained by education news site EAGnews.

The district complied and even provided a letter of recommendation that called Lang “an outstanding instructor.” Lang landed a job with Alton High School near the Mississippi River and about 15 miles north of St. Louis, Mo.He worked at the school until 2010, when he was convicted of molesting another female student and sentenced to six years in prison, according to the St. Louis Post-Dispatch.

Jon White was sentenced to 48 years in prison in 2008 for abusing ten students at schools in the Illinois towns of Urbana and Normal. But those victims might have been spared their ordeals if White’s past had been revealed.

He had previously worked in McLean’s school district, where he was twice suspended for viewing pornography on a school computer and for making sexually suggestive comments to a fifth-grader. Instead of being fired, the union-protected teacher was allowed to resign – with a letter of recommendation that made no mention of the incidents.

The families of students at Urbana Elementary eventually filed a lawsuit claiming that the Normal school District had misled Urbana, according to the News-Gazette of Central Illinois.

It took two years for the Ann Arbor, Mich., school district to get rid of orchestra teacher Chris Mark after he was caught having an inappropriate relationship with a student in 2010. His union contract ensured that he was on paid leave during the 13-step process required to keep him out of the classroom and off the district payroll, the Ann Arbor News reported in 2013.

Stephen Wright, a tenured science teacher at Downers Grove South High School in Illinois, kept his license to teach even after being accused of faking his hours, stealing district computers, inappropriately touching female students and discussing the sexual activities of himself and his students.

Wright was issued multiple warnings and three 10-day unpaid suspensions before the district finally petitioned the Illinois State Board of Education to consider his dismissal in 2002. It took nearly a year, but Wright was fired. Yet he kept his teaching license, and went on to work in at least six other Illinois school districts and two community colleges.

Dina Holder, a special needs pre-kindergarten teacher in California’s Brentwood School District, kept her job despite reports that she physically abused multiple students. After pleading no contest to a misdemeanor child abuse charge in 2010, Holder was transferred to a different school within the district -- which also paid a total of $8 million to the victims in January of this year.

According to state law at the time, a misdemeanor offense is only sufficient grounds for dismissing a tenured teacher if it involves “moral turpitude.” When Loma Vista Elementary failed to submit Holder’s performance review in 2010, the school was unable to fire her, and she remained employed until 2013.

Mark Krockover, a tenured chemistry teacher and cheerleading coach at Maine East High School in Park Ridge, Ill., was allowed to resign and given $60,000 severance after he was accused of harassment from seven female students. The girls said he touched them inappropriately, smelling their hair, texting them excessively and even buying several of them designer jeans and bikinis.

The school made records of Krockover’s past behavior confidential and agreed to tell future employers that he resigned for personal reasons. Krockover’s teaching license was finally suspended in 2011, after the Illinois Department of Children and Family Services investigated his resignation. He is currently eligible to reapply for his license but has not done so.

He was never formally charged, according to the Daily Herald in Cook County.

Neal Erickson is in prison for molesting a 14-year-old boy while he was a teacher in the West Branch-Rose City, Mich., school district. But even though he admitted to the repeated attacks, his union was there to help him long after his arrest in December 2012.

Several teachers wrote letters on his behalf, pleading for a lenient sentence. Although the judge was unmoved, sentencing Erickson to 30 years in prison, the Michigan Education Association brought the school district into arbitration seeking a $10,000 severance package for the convicted teacher. Erickson was eventually denied severance at the end of 2013, but not after a lengthy debate between the union and the school district.

Tenure protection kept Aryeh Eller in the New York City school district’s infamous “rubber room” for more than 10 years after he admitted repeated sexual harassment of female students at Hillcrest High School in Queens. Technically called reassignment centers, the rubber rooms warehoused teachers too dangerous for the classroom but too difficult to fire until 2010, when then-Mayor Michael Bloomberg denounced them as an "expensive abuse of tenure," and shut them down.

Eller, who receives annual, union-negotiated pay raises, now makes $85,000 per year and works in a district office away from children. He’s earned nearly $1 million in salary since being yanked from the classroom, and still has a job, according to The New York Post.

Another New York teacher, Queens math instructor Francisco Olivares, still earned his annual salary of nearly $95,000 after allegedly impregnating and marrying a 16-year-old student and sexually molesting two other students during his 32-year career.

It wasn’t because the district didn’t try to fire Olivares.

“The department twice tried to terminate this teacher, and both times, an arbitrator decided to keep him on the payroll,” New York Department of Education spokeswoman Ann Forte told the New York Post, adding that tenured teachers can be fired only if an arbitrator approves.

In Los Angeles, special education teacher Matthew Kim was finally fired in 2009, some seven years after co-workers and students complained of repeated acts of sexual harassment. He might still be drawing a paycheck if a state judge hadn’t stepped in, blasting a pro-union, three-member state commission that oversees teacher dismissals for its “profound contempt for, and disrespect of, the judgments and orders of the courts of this state.”

Superior Court Judge David Yaffe ruled that the state commission ignored evidence that Kim, who was born with cerebral palsy, was sexually harassing co-workers and students and said the commission was changing “the facts of the case to support its prior decision instead of changing its prior decision to one that is supported by the facts of the case,” according to the Los Angeles Times.

Kim earned his $68,000 annual salary throughout the process.

The beleaguered Newark, N.J., school district has had scores of incidents in recent years where teachers misbehaved and got nothing more than a slap on the wrist thanks to their union membership and the protections afforded by tenure.

One teacher, whose name was redacted from official documents, was alleged to have done numerous horrific acts to her students, including spraying a second-grader with mace, slapping other students and placing a stapler over a kid’s lips and threatening to seal them. She was allowed to stay on the job and collect her salary for six months before the school could get rid of her.

An elementary teacher in Newark who swore at, threatened and punched a 10-year-old girl in front of her classmates got nine months’ pay plus vacation and sick time in exchange for quitting.

FoxNews.com's Perry Chiaramonte and Jack Ellis contributed reporting to this story.