A middle-school teacher in the Orlando, Fla., area soon will be out on bail despite sending dirty text messages to a 14-year-old female student, MyFOXOrlando reported Tuesday.

James Stafford, 25, who teaches seventh grade at Corner Lake Middle School, was charged Tuesday with lewd conduct and sentenced to $2,500 bail plus home confinement after his arrest a day earlier.

Police said that for an entire night, Stafford sent graphic text messages to a 14-year-old girl's cell phone suggesting that she'd get a better grade in exchange for sex.

The bewildered student at first had no idea where they were coming from.

"She called the number back and realized it was a teacher," Sgt. Rich Mankewich of the Orange County Sheriff’s office told MyFOXOrlando. "To confirm it the next day, she texts the number in class and he answers the phone and she realizes it's the teacher doing it."

Stafford has been under investigation by the Orange County School District since Feb. 26, the sheriff said. He has been suspended with pay and won't be released from prison until the home confinement monitor is set up — which could take another two days.

His pregnant wife works at the same school.

Click here for a photo and more on this story from MyFOXOrlando.com.