HOUSTON – A former Aldine ISD middle school English teacher who became pregnant by a student pleaded guilty to a lesser charge Wednesday morning.

Alexandria Vera, 24, was accused of having a lengthy sexual relationship with a Stovall Middle School student. She became pregnant by the teen and later had an abortion when she was questioned about the relationship, according to court records.

Prosecutors said that between Sept. 30, 2015, and Jan. 30, Vera had sex at least two times with her eighth-grade student, who was 13 at the time.

Vera, admitted to having a sexual relationship with the student since last September, authorities said. A report said the student was in her class.

Vera, who worked for the Aldine Independent School District, was originally charged with continuous sexual abuse of a child, but pleaded guilty to the lesser charge of aggravated sexual assault of a child.

The new charge carries a maximum of life in prison, but both prosecutors and defense attorneys agreed to cap the maximum amount of time for the charge to 30 years in prison.

Vera was released on a $100,000 bond earlier this summer and ordered not to have any contact with the victim, stay off the internet, have her location tracked by GPS, stay in her house between 8 p.m. and 7 a.m., not talk with any kids or go near any schools.

Vera told police that she first met the student during a summer school session. The DA's Office said the student tried to communicate with her on Instagram. She later sent a message to the student after he didn't show up for class, which led to the student asking for her phone number, prosecutors said.

Vera said the student asked if the two of them could hang out and she agreed, according to court documents. She told an officer that she drove to the student's house to pick up the boy, and they drove around and kissed in the car, court documents said.

Vera said she drove to the student's house again the next day because the student's parents were not home, the report said. According to the report, Vera said that was the first time when she and the boy had sex. Officials believe that was in September.

Vera said the student's parents not only knew about the relationship, they approved of it and allowed the teen to spend the night at Vera's home in Spring, where they engaged in sex on a regular basis, according to court documents. She told an investigator that she would drop him off at home in the morning so he could catch the bus to Stovall Middle School, prosecutors said.

Vera told an officer that the school had an open house in October, when she met the student's parents. After the open house, Vera went to the student's home and was introduced as his girlfriend to his parents. According to the report, Vera said the parents were accepting of their relationship and she was invited to family gatherings.

Vera told investigators that the relationship with the student grew, and they continued to have sex and spend time together. According to court reports, Vera said she got pregnant with the student's baby in January. She told the officer that the student's family was told about the pregnancy and that they were supportive and excited about the baby, prosecutors said.

Court documents said Vera had an abortion because she got nervous when Child Protective Services showed up at school in February to question her and the student about their relationship. The DA's Office said Vera denied the relationship then.

An officer did a forensic examination of Vera's phone. According to the report, many messages between the teacher and the student were consistent with what she said.