PHOENIX — A former suburban Phoenix elementary school teacher avoided the maximum sentence Friday for sexually abusing a 13-year-old student, including engaging in a sexual act in the presence of a second boy.

Judge Sherry Stephens opted to sentence Brittany Ann Zamora to 20 years in prison instead of the 27 years prosecutors had asked for under a plea agreement. Zamora will also be on lifetime probation upon her release and have to register as a sex offender.

"The defendant did accept responsibility by pleading guilty. She has expressed her remorse. She has no prior criminal history," Stephens said.

Zamora, 28, apologized in court to the victims and to her family.

Brittany speaking to Judge Stephens “I’m sorry...truly regret what took place, my actions are completely out of place for me. Im not a threat to society by any means,” says Zamora. @abc15 — Karla Navarrete (@NavarreteKarla) July 12, 2019

"I'm not a threat to society by any means," Zamora said, sniffling at times. "I'm a good genuine person who made a mistake and regrets it deeply."

Authorities say Zamora had multiple sexual encounters with the 13-year-old boy in a classroom at Las Brisas Academy in Goodyear and in her car during February and March 2018.

RELATED: District responds to family's claim of sexual abuse by teacher

Some physical contact between Zamora, who at the time was 27 years old, and the sixth-grader occurred during class while other students were watching a video, according to documents.

Investigators also say a second boy, age 11, had seen Zamora having sex with the 13-year-old student. They say Zamora showed naked photos to both boys and asked them sexual questions.

Both children's families had asked the judge to deliver the harshest punishment possible. In a statement read by their attorney, the 13-year-old's father and stepmother called Zamora a "twisted monster" who stole their son's innocence.

"He will miss out on so many important emotions and feelings when it comes to relationships with women for the rest of his life -- all because his trust was betrayed by sixth-grade school teacher," they wrote.

His family also argued that Zamora would likely receive a stiffer sentence if she were a man who had committed the same crimes with a girl.

"I'm also angry at those who say they think abuse like this of a woman on a young man is somehow les serious if it happened to a girl instead of a boy," the 13-year-old's mother said in a statement. "Every child no matter their sex deserves to have their period of adulthood free of monsters."

Zamora's defense attorney and family said the crimes were out of character for her. They cited her father's abandonment of her when she was 13 years old and ongoing issues with anxiety, depression and obsessive compulsive disorder as mitigating factors.

"She's a great candidate for rehabilitation," defense attorney Belen Olmedo Guerra said. "She wants to change her life and she's already started that."

Zamora could have faced 40 years in prison for her guilty pleas a month ago to sexual conduct with a minor, attempted child molestation and public sexual indecency.

Her plea deal called for her to be sentenced to at least 20 years on the sexual conduct conviction and didn't make recommendations on the other two convictions.

As part of the plea agreement, 12 other criminal charges against Zamora will be dismissed.

The boy told authorities that the sexual encounters began after he and Zamora started messaging each other in a classroom chat group. Police say Zamora sent the boy nude photos after sending messages to each other.

She was arrested in March 2018 after the victim's father and stepmother discovered text messages between her and the child. Zamora and her husband, Daniel, had called the boy's father, pleading for him not to call police, the father told authorities.

Daniel Zamora was named in a lawsuit filed by the boy's family but the two parties have since settled for an undisclosed amount, the Arizona Republic reported . The suit alleged Daniel Zamora never alerted authorities about the molestation. He also left the victim's father emotionally distressed by his phone calls, attorney Steve Weinberger said.

Attorneys declined to comment on the judge's sentencing decision. They said they plan to focus on holding school administrators accountable.

A lawsuit filed by the parents said the Liberty School District failed to investigate reports of misconduct involving Brittany Zamora, an allegation the district has denied.

The lawsuit alleged three students told the school's principal about six weeks before Brittany Zamora's arrest that there was an inappropriate relationship between the teacher and student.

The district said in court records that the principal talked to the students about rumors of the relationship, but acknowledged he didn't immediately notify police or the victim's parents about the rumor.