"Most of the animals stayed near the vehicle," a road safety official, Captain Jean Chevassu, told AFP.
"Two or three pigs... strayed further. It wasn't too hard to recover them."
The driver of the tractor-trailer lost control, leaving the vehicle lying across the two-lane road near the western city of Poitiers, shutting it for most of the day.
The impact tore a hole in the roof of the truck, through which most of the some 180 pigs emerged onto the road and into the surrounding forest.
Twenty-six died on the spot, while another 13 with severe injuries were put down.
Veterinarians teamed up with highway officials and police to coax the animals into makeshift pens created using movable traffic barriers and the road's guard rails.
One of the errant pigs met its fate further down the road, when it was hit by a car, Chevassu said.
The driver was hospitalised with slight injuries.