This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

An Orange County high school football coach accused of having sex with a 17-year-old student was arrested after a lengthy standoff on campus last month during which he threatened suicide, officials said.

Michael Schnitzler is seen in a booking photo released April 23, 2017, by the Orange Police Department.

Former El Modena High School coach Michael James Snitzler, 26, was charged Wednesday with misdemeanor unlawful sexual intercourse and child annoyance following investigating by Orange police, Orange County District Attorney’s officials said.

The Santa Ana resident was previously charged with two felonies — possession of a firearm in a school zone and discharging or attempting to discharge a firearm in a gun-free zone — and misdemeanor possession of ammunition on school property on April 25.

Authorities began investigating Snitzler after he locked himself in a classroom on the school’s campus with a loaded handgun, threatening suicide, around 10:45 a.m. on April 23, a Sunday. One of his family members had called police, prosecutors said.

For 10 hours, streets surrounding the school were shut down as Snitzler refused to exit the classroom, according to Orange police. He eventually surrendered without incident at 8:35 p.m.

El Modena High School is shown in an undated Google Maps Street View image.

The 26-year-old worked as the school’s assistant varsity football coach at the time.

A probe of the situation revealed Snitzler had been engaged in a sexual relationship with a 17-year-old El Modena student, DA’s officials said.

Prosecutors allege the relationship began in February, when Snitzler met the minor and began communicating with her via text message.

Their relationship became sexual in March, investigators said.

If convicted as charged, Snitzler faces a maximum possible sentence of 10 years and six months in state prison.

He is scheduled to appear in court on May 12 for a pre-trial hearing and is currently being held on $30,000 bail.