LOS ANGELES - A high school teacher who had sex with two of her male students was sentenced today to five years probation and barred from teaching.

Gabriela Cortez, 43 -- a Spanish teacher at Roosevelt High School in Boyle Heights -- pleaded guilty Nov. 19 to six felony counts of unlawful sexual intercourse.

Los Angeles Superior Court Judge Edmund W. Clarke Jr. told Cortez that parents have an expectation that "when a child goes off to school he will be treated as if they were there watching" and that Cortez breached that trust.

But the judge said he was persuaded by Cortez's attorney, Edward Robinson, that probation would be "the just sentence."

The conditions of probation bar Cortez from working in any teaching, coaching or mentoring position and from being in the presence of minors -- other than her own daughter -- without other adults present. She is also required to undergo counseling, which the judge said had already begun.

The crimes occurred between September 2009 and November 2010, primarily in Cortez's Montebello home, when the boys -- now adults -- were 16 and 17, according to Deputy District Attorney Hyunah Suh.

Cortez was arrested Feb. 22 by Montebello police and released later that day after posting $140,000 bail.

Montebello police Lt. Luis Lopez said the investigation began Feb. 15, after one of the victims came forward to report being molested by a teacher, saying he wanted to get things "off his chest."

The investigation triggered by that victim led to the second victim, who "provided information regarding a sexual relationship involving him and the suspect," the lieutenant said.

Cortez could have served a maximum sentence of six years and four months behind bars. A probation report requested by the judge also recommended granting probation rather than jail time, according to Suh.