According to media reports, the accused, identified as Hemanth, was the victim's maternal uncle. He had reportedly been stalking her and had proposed to her in the past.
Police have formed special teams to track down and arrest the attacker, who remains on the run.
Hemanth allegedly entered the classroom with a chainsaw at around 10.30 am on Saturday and attacked the two girls, leaving one of them critically injured. The incident took place while a teacher was present and lessons were underway.
The accused, also known as Dummu, hails from Nagaluru village in Sri Sathya Sai district and had been staying with his elder sister at Ayyavaripalle village, Anantapur Rural Sub-Divisional Police Officer K Ashwin Manideep told Hindustan Times.
The injured girl was initially admitted to Anantapur Government General Hospital, where she underwent surgery, state Health Minister Y Satya Kumar was quoted as saying by the newspaper.
However, as her condition deteriorated, she was shifted to a super-speciality hospital in Bengaluru in a special ambulance for advanced medical treatment.
“A green channel has been provided for the ambulance to take the girl to a private hospital in Bengaluru,” the minister said, adding that her condition was being closely monitored.
Andhra Pradesh Chief Minister N Chandrababu Naidu said he was 'shaken' and enraged by the incident.
"I am deeply shaken and enraged by the barbaric attack on a Class 10 student inside her classroom at Raptadu ZP High School. Attackers who target our young girls inside schools have no place in our society," he said.
The Chief Minister further said that he was personally monitoring the girl's recovery and had directed doctors to provide her with the highest priority care.
"I am personally tracking her recovery and have directed the medical team to give her the highest priority care. I have ordered the police to hunt down the monster responsible and deliver the harshest legal punishment swiftly," he added.