According to regional news website Press Ocean, the Tunisian student was asked by her science lecturer at the University of Nantes in western France to remove her hijab when she arrived for the course.
The 24-year-old refused, at which point she is believed to have been asked to leave the lecture. The student went immediately to complain to officials in the Faculty of Sciences.
A controversial 2004 law prohibits the wearing or open display of religious symbols in all French schools and colleges, but it does not apply to universities. A similarly contentious law was introduced in 2010 banning the wearing in public of the full Muslim face veil, the niqab. It did not however forbid the wearing of the hijab headscarf.
Realizing the embarrassing mistake, faculty bosses quickly returned the student to the lecture, where the teacher made an apology.
It is believed the stand-in lecturer may have made the error because he is usually employed in a lycée college, where the hijab headscarves are banned.
Police sources confirmed to Presse Ocean that the student had lodged an official discrimination complaint.
Follow the Local France on our Facebook page or on Twitter @TheLocalFrance