The boar, which was wandering along the Ooty-Mysore road, fell into the pit around 5.30 AM.
The passers-by noticed the animal struggling to climb out of the pit, which was dug at a length of 1.5 kms for laying telephone cable for a private firm, police said.
When the forest department officials, with the assistance of public, got down to the pit and attempted to bring it up, the boar began running to other end out of fear, they said.
The public filled the pit on one side with soil and brought the boar up by tying rope and lifting bodily, toiling for over four-and-half-hours, police said.