A teacher in California has quit his job, after penning a column for the student newspaper that claimed gay people deserve to be put to death.

Michael Stack had worked as a special education teacher at San Luis Obispo High School.

However, he provoked anger over a letter he wrote for school newspaper Expressions suggesting that homosexuals are deserving of death.

The letter, published on the Expressions website on Tuesday, responded to an issue which featured a same-sex kiss on the cover and included a coming out story.

It says that gay people are doing “vile and shameful things with each other’s bodies” by rejecting God.

Stack continued: “They know God’s justice requires that those who do these things deserve to die, yet they do them anyway. Worse yet, they encourage others to do them too.”

After the publication of the letter, school authorities initially insisted they would not discipline the teacher, telling the San Luis Obispo Tribune that he had been exercising his “First Amendment rights” in the letter.

However, Stack failed to turn up to work the following day, and later sent a resignation letter quitting his job anyway.

According to the Tribune, he wrote: “I love the staff and students at SLOHS. My students know that. But I love God more.”

A pro-LGBT vigil was held outside the school today, to protest the comments and the handling of the situation.

In his letter, Stack wrote: “God shows His anger from heaven against all sinful, wicked people who suppress the truth by their wickedness…

“They [do] vile and shameful things with each other’s bodies. They traded the truth about God for a lie.

“They worshipped and served the things God created instead of the creator Himself, who is worthy of eternal praise! Amen. That is why God abandoned them to their shameful desires.

“Even the women turned against the natural way to have sex and instead indulged in sex with each other. And the men, instead of having normal sexual relations with women, burned with lust for each other.

“Men did shameful things with other men, and as a result of this sin, they suffered within themselves the penalty they deserved.”

It continues: “Since they thought it foolish to acknowledge God, He abandoned them to their foolish thinking and let them do things that should never be done.

“Their lives became full of every kind of wickedness, sin, greed, hate, envy, murder, quarreling, deception, malicious behavior, and gossip. They are backstabbers, haters of God, insolent, proud, and boastful.

“They invent new ways of sinning, and they disobey their parents. They refuse to understand, break their promises, are heartless, and have no mercy.

“They know God’s justice requires that those who do these things deserve to die, yet they do them anyway. Worse yet, they encourage others to do them too.”

Watch this grade one teacher’s brilliant story about lesbian cannibals