Methane from the 90 cows reached unusually high levels on Monday.
The gas reacted with static energy from a massaging machine in the stalls, which is used to increase milk production, creating flames which soon spread.
The roof of the barn was slightly damaged in the fire and one cow was treated for burns, but emergency services were able to prevent further injuries, police said.
Fire crews were called to the farm in the village of Rasdorf, Hesse, and brought the blaze under control.
Member comments