The account is in the three Synoptic Gospels, specifically in Mark 5:1-20, Matthew 8:28-34, and Luke 8:26-39. All accounts involve Jesus exorcising demons, identified collectively as Legion in Mark and Luke.
The Gospel of Mark reports the miracle as taking place when Jesus went across the lake to Gerasenes, the modern Jerash in Jordan. There a man possessed by an evil spirit came from the caves to meet him. No one could bind this man anymore, not even with a chain, for no one was strong enough to subdue him. Night and day among the tombs and in the hills he would cry out and cut himself with stones.
When he saw Jesus from a distance, he ran and fell on his knees in front of him. He shouted at the top of his voice, "What do you want with me, Jesus, Son of the Most High God? In God's name don't torture me!" For Jesus had said to him, "Come out of this man, you evil spirit!"
- Then Jesus asked him, "What is your name?"
- "My name is Legion," he replied, "for we are many."
And he begged Jesus again and again not to send them out of the area.
A large herd of pigs was feeding on the nearby hillside. The demons begged Jesus, "Send us among the pigs; allow us to go into them." He gave them permission, and the evil spirits came out and went into the pigs. The herd, about two thousand in number, rushed down the steep bank into the lake and were drowned.
Those tending the pigs ran off and reported this in the town and countryside, and the people went out to see what had happened. When they came to Jesus, they saw the man who had been possessed by the legion of demons, sitting there, dressed and in his right mind; and they were afraid. Those who had seen it told the people what had happened to the demon-possessed man—and told about the pigs as well. Then the people began to plead with Jesus to leave their region.
Divergence in synoptic and textual traditions
In Matthew's gospel, the manuscript tradition is split between the location being Gadarenes (such as the Codex Vaticanus) and Gergesenes (such as the Codex Washingtonianus). In Mark's account, manuscripts such as the Codex Vaticanus and the Codex Bezae have "Gerasenes", the Codex Alexandrinus and the Codex Ephraemi Rescriptus have "Gadarenes", while some other manuscripts have "Gergesenes". In Luke's account, Papyrus 75 has "Gerasenes", Codex Alexandrinus has "Gadarenes" and Codex Sinaiticus has "Gergesenes".
Matthew reports two men, but Mark and Luke report just one man, possessed by a demon called Legion, for it represented many demons at once.
- The Life and Ministry of Jesus: The Gospels by Douglas Redford 2007 ISBN 0-7847-1900-4 page 168
- Biblegateway Mark 5:1-20 
- Biblegateway Matthew 8:28-34 
- Biblegateway Luke 8:26-39 
- Brown, Raymond E. et al., The Jerome Biblical Commentary, Englewood Cliffs, New Jersey: Prentice-Hall Inc., 1968, p. 32.
A portion of the proceeds from advertising on Digplanet goes to supporting Wikipedia.