Victor Angulo, 12, was seen on CCTV in March as he studied underneath a street lamp in the town of Moche because his home has no electricity.
A video of the boy completing his homework in the street went viral on Instagram and caught the attention of Yaqoob Mubarak, who last month flew to Peru to meet the boy and his family.
Mubarak returned to Moche over the weekend to start work on the house.
Mr Mubarak said: “This kid will make a big story, a big success story for all the kids in the world.
“I am going to sign this contract in front of you, already bought 15 computers to open the new computer class.”
Mr Mubarak has promised to give the family money to start a business and gave one of Victor’s friends, who is disabled, a wheelchair.
Victor said: “Yaqoob Mubarak, I want to thank you for all that you are doing for us, for the children of the school, as well as for Alvaro who is one of our brothers, you are helping him, and for that we thank you very much.”
He also visited the boy’s home, and has promised to take Victor and his mother to visit Bahrain later this year.
In a ceremony, Arturo Fernandez, Moche’s mayor said: “Carlos Villanueva [a local resident] posted on Instagram the video of Victor and Yaqoob, from Bahrain… saw that majestic video and the message touched his heart.”