The panels at Gwaun Cae Gurwen County Primary school in the Amman Valley were switched on last week by Wales' social justice and regeneration minister, Edwina Hart.
"The renewable energy that these panels produce will help reduce harmful carbon dioxide emissions, which contribute to climate change," she said.
"Not only will the school be helping the environment but it will raise about 1,500 a year, partly from the sale of the electricity it doesn't use when the school is closed."
Pupils can watch a monitor that gives a minute-by-minute breakdown of the number of kilowatts being generated. They are involved in a number of other environmental initiatives, including recycling and switching off lights in empty rooms.
The eco-school scheme encourages schools to work with the local community to enhance their environment.
- www.eco-schools.org.uk.