Five sows and their piglets were killed during a blaze at Portland Pigs Farm on Portland.
The blaze, thought to have been caused by rainwater affecting electrics in the roof of a shed, was attended by around 15 firefighters.
Crews were called at 8.30am on Monday after the property owner spotted smoke rising from the building.
Firefighters rescued two sows and their young at the scene by using a sound and thermal imager.
Another 20 sows remained in the pig shed – safe in an area that was unaffected.
There was fire damage to approximately half of the building, a Dorset Fire and Rescue Service spokesman said.
The fire was under control by 10.30am. Firefighters had their equipment, which included one hose jet and two sets of breathing apparatus, decontaminated following the incident due to the presence of asbestos in the shed.