The Spanish Civil Guard have arrested one former teacher and another current teacher who are suspected of having distributed the messages from a private chat group on instant messaging app WhatsApp, Spanish newspaper El Pais reported on Tuesday.
The former teacher was already involved in litigation with the school.
The two are accused of a crime of "disclosing secrets" because the messages were within a private group.
Police believe the two arrested extracted messages from the chat, modified them and put them together in the letter that showed up mailboxes across the town.
In one message, a teacher called Moroccans "sons of bitches" in response to another teacher saying that "no Moor is good", though this conversation may not have been in reference to any pupils at the school, El Pais reported previously.
In another conversation, referring to a student, a teacher said "What's the name of that pig of a boy who is always getting in trouble at recess?"
After a mother accused one of the teachers of mistreating her children, that teacher called the mother "the bitch" and said that the mayor of the town had recorded images of one of her children "who you are flipping out about", though the mayor has since denied such images exist.
The Ministry of Education suspended the headmaster of the school as a precautionary measure in April and agreed to open a disciplinary inquiry into six of the 11 teachers in the WhatsApp group.
The Civil Guard began investigating the letter on April 10th after receiving a complaint about the messages from the school's teachers who said the letter could be from a teacher involved in litigation with the school who wanted revenge.
Through the messages, the police were able to identify the former teacher as well as the other teacher who had been part of the group and helped distribute the letter.
The two could face prison time of between one and four years.