A Texas teacher who admitted to having sex repeatedly with her 13-year-old student and got pregnant with his child has been sentenced to 10 years in prison.

Alexandria Vera pleaded guilty to aggravated sexual assault of a child and received the sentence Friday, KPRC reported. The former Aldine teacher, who has a six-year-old daughter, had admitted to having a sexual relationship with one of her eighth grade students.

Vera claimed the boy's parents accepted the relationship. Prosecutors said she had sex with him at least twice between September 30, 2015 and January 20, 2016.

The former teacher got pregnant with the victim's child in January. She had an abortion when investigators started looking into the case, court records state.

Former teacher Alexandria Vera (pictured in court in Houston Friday), 24, was sentenced to 10 years behind bars on Friday for having sex with one of her students

Prosecutors said Vera (pictured arriving to court with her attorney Ricardo Rodriguez Friday) had sex at least twice with the victim between September 30, 2015 and January 20, 2016

The former teacher faced a maximum sentence of 30 years. She will be eligible for parole in five.

Authorities originally charged her with continuous sexual abuse of a child, but changed it to a lesser charge of aggravated sexual assault of a child when she pleaded guilty.

A judge told the court at sentencing Friday that he doesn't believe Vera to be a threat to other children. But he said the sentence had to send a message.

'We want out educators to teach our students,' he said in court according to the Houston Chronicle. 'We want them to keep their hands off the students.'

The boy has been placed in foster care at least until August.

Vera (pictured left and right) told investigators the 13-year-old boy's family was accepting of the relationship. She became pregnant with his child but later had an abortion

Rodriguez (pictured left next to Vera Friday) called as a witness a therapist who said Vera had grown up witnessing domestic abuse and had a strong need for love

Prosecutors said in court that Vera acted deceptively and had the boy and his father stay at her home while pretending to date the father. They said Vera's daughter sometimes called the victim 'dad' and knew about their relationship.

Vera's defense attorney called as a witness a therapist, who said Vera had grown up witnessing domestic violence and had a strong need for love, as well as a 'big heart'.

'I think she was driven by being in love with him,' mental health professional Karen Lawson told the court.

Lawson painted Vera as a responsible person, who had worked jobs since the age of 14, bought her first home at 21, and put herself through college, KHOU wrote.

But the prosecution questioned Lawson over apparently pornographic photos of the victim found on Vera's cellphone, and said the teacher had allowed other students to have sex inside her house.

Vera (pictured left in a mugshot and right in a selfie) had an abortion after becoming nervous due to a visit from Child Protective Services in February, court documents state

Vera previously told authorities she met the boy during summer school. She sent him a message on Instagram after he missed class one day, according to the prosecution.

The teacher later told authorities she drove to the boy's house and picked him up, after which they kissed.

Vera drove to his home again the following day while his parents were away and the pair had sex for the first time that day, according to court documents. She told investigators that their relationship carried on afterwards and they continued to have sex.

Another student recounted seeing his classmate acted inappropriately with the teacher at school.

'He like grabbed her butt, and everybody saw it,' the student told ABC 13. 'And then they were talking about it.'

She said the boy's parents accepted their relationship and were supportive and excited when she became pregnant with their son's child in January 2016.

Vera had an abortion after becoming nervous due to a visit from Child Protective Services in February, court documents state. Officials came to the school to question her and the boy.

The 24-year-old briefly went on the run over the summer before turning herself in. Authorities had released her on a $100,000 while telling her not to contact the victim, not to go online, remain at home from 8 pm to 7 am.

She had to wear a GPS tracker and was not allowed to go near any school or talk to children.