It happened at 7500 West and 2050 South near Magna.
Firefighters from across Salt Lake County responded the the fire.
When the first arrived, the barn was fully engulfed in flames, but they were able to put the fire out before it damaged any nearby buildings.
The location made it difficult to fight, because the firefighters had to stretch over 2,000 feet of hose from the nearest fire hydrant.
Both horses and pigs were located at the farm, but firefighters say none were injured in the fire.