Oklahoma teacher Haylie Smart, 29, was arrested on a charge of second-degree rape, for allegedly having sex with a student, starting when he was 17 years old

An Oklahoma high school teacher has been arrested on allegations of having sex with a student, starting when he was 17 years old.

Haylie Smart, 29, was arrested on a charge of second-degree rape, the Rogers County Sheriff’s Office said.

She's accused of having sex with the Oologah-Talala High School student both after class and at his home.

Smart's employment with the School District I-004 ended on May 29, Max Tanner, superintendent of Oologah-Talala Public Schools, said in a statement toTulsa World.

Smart could not immediately be reached for comment.

Smart is accused of having sex with a Oologah-Talala High School student, starting when the student was 17 years old, both after class and at his home

Smart was not discreet about her sexual relationship with the student, according to law enforcement documents.

The probable cause affidavit states she began rubbing the student’s back and placing her head on his shoulder in October 2017.

At some point, Smart and the student were said to have hugged in front of other students multiple times.

The two allegedly began having sex in November, according to the documents.

The student turned 18 in December. Regardless of the student's age, it's illegal for a teacher to have sexual encounters with a student, under Oklahoma state law.

Regardless of the student's age, it's illegal for a teacher to have sexual encounters with a student, under Oklahoma state law

It's believed Smart had sex with the student both after class, and also at his home, during a two-week statewide teacher walkout.

Smart sent a message to a friend in May about her alleged relationship with the student, and noting the school's investigation.

She said she believed the school would find sufficient evidence to fire her, according to authorities.

Smart was suspended from the school district in May, and she resigned from her position several days later, Oklahoma News 4 reported.

The warrant for Smart’s arrest was issued on August 17, the Sheriff’s Office said.

She turned herself in to authorities on Friday and was released after posting a $25,000 bond.

Smart could not immediately be reached for comment.