A former US high school teacher was sentenced to 40 years in prison for having sex with multiple students between 2014 and 2016.

On Tuesday, Janet Barnes pleaded guilty to two charges of rape and one count of sexual battery.

She will serve 40 years at the Mabel Bassett Correctional Centre in Oklahoma and is required to file as a sex offender.

Janet Barnes pleaded was jailed for 40 years for having sex with multiple students. (Supplied)

Barnes allegedly had sex with two minors between January 2014 and November 2016 while she worked at Pocola High School. During the same time, the indictment states Barnes committed sexual battery against another minor, unrelated to the ones she is accused of raping.

A student at Smithville Public Schools in Smithville, Oklahoma, told police in 2010 that Barnes asked him to have sex and sent him nude photos over four months, according to court documents. The boy, who said he felt like Barnes was "stalking him," also said she exposed herself to him.

In 2012 Barnes pleaded guilty in McCurtain County District Court to outraging public decency involving a student younger than 16. Barnes was given a nine-month suspended sentence and had to pay more than US$400 in fines and court costs. The judge also issued her a no-contact order with the student.