Scotlandville Magnet High School’s band director was fired Friday, a day after he was accused of having sex with a student on at least two occasions — one of them consensual but illegal and the other a rape, authorities said.

Keith Bromery, East Baton Rouge Parish school system spokesman, said staff at the north Baton Rouge high school learned of the allegations against Robert M. Lewis in mid-December, alerted the Sheriff’s Office and placed Lewis on administrative leave. Bromery would not elaborate on the reasons for Lewis’ firing.

“He is no longer employed by the district as of today,” Bromery said.

Lewis, 30, of Zachary, remained in Parish Prison on Friday with bail set at $100,000. He was booked late Thursday on counts of forcible rape and prohibited sexual conduct between educator and student.

Bromery said Lewis was hired as a substitute teacher in August 2008. He was hired as band director at Scotlandville in December 2009, left the school district for a while and was rehired as the school’s band director in July 2013.

Lewis is married to a fellow teacher at Scotlandville High. Attempts to reach the two Friday were unsuccessful.

Lewis is accused of making sexual advances toward a 17-year-old student after he gave her a ride home from a school function in November.

After that, the student and Lewis began exchanging text messages, officials have said. In late November, when the student’s parents were out of town, Lewis took food to the student, said Casey Rayborn Hicks, spokeswoman for the Sheriff’s Office. Lewis allegedly initiated sex, even though the student told him no, Hicks said.

Lewis also is accused of meeting the student at her house, again while her parents were not home, in early December, Hicks said. “The student stated on this date the two had consensual sex,” Hicks said.

In Louisiana, it is illegal for noncollege teachers to have consensual sex with a student who is 17 or older but younger than 21, when there is an age difference of four years or more. Generally, the age of consent in Louisiana is 17.

Hicks said the Sheriff’s Office first learned about the case in December when an unnamed third party alerted deputies to inappropriate text messages, but the allegations could not be substantiated because the person who complained stopped cooperating. The rape allegation came to light in the past couple of days, she said, and the investigation is ongoing.

Follow Charles Lussier on Twitter, @Charles_Lussier.