The sty, which is located just north of Tomelilla in Sweden's south, caught fire early on Tuesday morning for reasons as yet unknown.
"It's a big sty with thousands of pigs that's burning," Roger Larsson of the Sydöstra Skåne emergency services told the TT news agency at around 7am.
Police were notified about the blaze shortly before 5:30am, and fire fighters were on the scene soon after.
"According to the preliminary information, the fire has spread to several nearby buildings," Mia Sandgren of the Skåne police said.
Story continues below…
By 8am, the fire was still burning, but under control, and Larsson confirmed that many of the pigs had made it out alive.
"The pigs are alive, most of them anyway, as far as we can tell. A vet is on hand to check on their status when we get them out," he told the Skånska Dagbladet newspaper.