While the 19-year-old assailant died on the spot, the critically wounded teenaged girl was rushed to the trauma centre in Lucknow, where she is battling for her life.
Durgesh, a resident of Girdharipurva village, was in a one-sided love affair with the teenaged girl, Amethi Superintendent of Police Alankrita Singh told IANS.
The girl's family had protested against Durgesh's advances in the past but to no avail, police said.
On Tuesday morning, the girl had gone to the secondary school as usual, when around 8 a.m., Durgesh barged into the school premises, carrying a polythene bag in which there were two locally-made pistols.
The man entered the classroom, held the girl's hand and asked her to come out. When she refused, he pointed the pistol at her and shot her in front of other students and staff.
He then pulled out the other pistol and shot himself in the temple. He died on the spot.