The National Grid was accused of restricting competition and therefore denying customers access to lower prices and better services after it struck a deal with energy suppliers to own gas meters, restricting their abilities to replace them with more energy-efficient ones.
"This ruling confirms that National Grid has abused its dominance in the domestic gas metering market, restricting competition and harming consumers," commented Ofgem's Lord Mogg.
Ofgem had previously levied a fine of £41.6 million but this was reduced.
National Grid said it was disappointed with the ruling.
Ofgem aims to secure Britains energy supplies by promoting competitive gas and electricity markets and help the industry achieve environmental improvements.
Click here to run an energy price comparison, and see if you could be paying less for your gas and electricity.