Fifteen-year-old Sarvesh Verma, son of illiterate parents, scored 96.83% in the test and has been widely praised in India for his hard work.
In the villages of Uttar Pradesh, the power supply is intermittent and Sarvesh said he mostly had to study under the light of a solar lantern.
Although secondary school exams are optional and do not have much significance on their own, they are taken by tens of millions of students every year across India to prepare for the really crucial higher secondary exams.
Success stories involving students from poor backgrounds like Sarvesh are not uncommon, but for the moment, Sarvesh and his family are revelling in his success.
"My son has brought me immense joy," said his father Swaminath Verma, who owns a tiny plot of land and sells vegetables to supplement his income.
"I could not study because of financial problems, so I thought I must send my children to school and wipe out the darkness from their lives," he added.
"We knew he will do well, but we didn't know he will be a topper. We never had to ask him to study. He always say he has to study so he can improve our lot," said his mother, Sona Devi.
Sarvesh, who lives in Sahsaraav village, has to cycle 10km (6 miles) to reach his school in Haraiyya town.
He credits his success to his parents' hard work and co-operation from his teachers.
"I got tremendous support from my school teachers," he said.
When he grows up, he wants to join the civil service and fight corruption, since the "culture of giving and receiving bribes is a huge problem in our society".
"We must think how to eradicate corruption. In my village the public distribution system is in a bad shape. People who deserve subsidised food grains sold through ration shops do not get them. All this must change," he added.
In a school competition last year, Sarvesh won a tablet and said he often goes on the internet to see what is going on in the world.
But, he added, he is not a fan of social media and is not on Facebook.
The son of a poor Indian farmer who has beaten nearly 3.5 million students to top secondary school exams in the northern state of Uttar Pradesh talks to BBC Hindi about his struggles and ambition.