The girl was on her way home to Kammampatty village from her school at Mecheri yesterday when the 17-year-old boy dragged her to a secluded spot beside a river and raped her.
Hearing her screams, locals rushed to the spot, caught hold of the boy and thrashed him, police said.
He was handed over to police today.