The incident occurred in a busy area near the famous Sri Andal temple.
The 17-year old girl was rescued by Thangamankani, son of former local AIADMK MLA Thamaraikani, who was among the passers by in the area, police said.
She has been admitted to a local hospital.
The reason for the attack was under investigation, polie said adding the girl was a student of a private school and had gone to another school, which is an examinination centre, to write the exam.