The Colorado STEM school where a shooting this week left one student dead and eight injured did not have a resource officer on duty after a dispute last year with the county sheriff's office.

The sheriff's office for Douglas County, Colorado, in suburban Denver, has released documents showing that it did not renew its contract with the school last year after a dispute over the assigned deputy's role.

Sheriff Tony Spurlock “did not feel the STEM School could follow the requirements of the agreement” about the resource officer, he said in a statement on Friday.

STEM School Highlands Ranch, a charter school with 1,850 students in elementary grades through high school, said schools with resource officers have also unfortunately experienced violence.

The school partnered with the county sheriff's office from 2013 through 2018 to have a resource officer (SRO), the school's statement said. "That partnership was excellent from our perspective, but we began to have challenges with the SRO assigned to us in 2018."

After the dispute, the school still had a daily part-time, off-duty sheriff’s deputy with a squad car in addition to full-time private security, the statement said.

"That combination gave us a significant increase in protection for our staff and students," the statement said. "The unfortunate fact is that schools with and without SROs have experienced violence."

The sheriff's office documents show that when there was a resource officer at the school, their duties included providing counseling on law enforcement matters, investigating public safety issues and "serve as a first-responder as needed."

The records show that the assigned officer in 2018 had become ill. In some instances, the sheriff’s department provided a substitute officer to fill in during the remaining school year.

The school’s discontent with the situation appeared to grow after it started receiving complaints from surrounding businesses over traffic and long drive lines around its building, according to the sheriff's office documents.

The school expected the resource officer to help with traffic and became upset when the sheriff’s office asked the deputy to prioritize other duties. This eventually led the school to send a letter to the sheriff and ask for a partial refund.

The sheriff agreed in writing to waiving some fees but said, "It appears we do not share a common understanding of the role our school resource officers play in educating our community's youth and protecting our schools.”

Student Kendrick Castillo died during Tuesday’s shooting after he, alongside other classmates, rushed one of the two shooters. The two suspects in the violence are expected to appear in court on Wednesday.

The private security guard hired by the school was credited with taking one of the suspects into custody during the shooting, NBC affiliate KUSA reports. The investigation is also looking at whether the private guard fired on a responding sheriff's officer,