"Even after three hours, there was no sign of the sword coming up from the grave," a local police official told AFP.
"That is when the onlookers decided to pull him out anyway, but he was unconscious," the unnamed official said.
The 32-year-old man, identified by police as Maxi Castro, a local exorcist, was taken to hospital early Thursday morning but he had already died, the official said.
The man had been requested to drive out demons feared residing in the home of a school teacher at the village of Pelanwatte.
"I saw him perform a ritual like this at a temple six months ago and invited him to check my property," the teacher, Wasantha Bandara, told local radio station Shree FM."He said I had bad luck because someone had sprinkled human ash at my house, but he could drive out evil spirits through this ritual."
Police spokesman Buddhika Siriwardena confirmed the incident and said an investigation was underway.
Many in Sri Lanka, where 70 percent of the population are Buddhists, have faith in black magic, sorcery and exorcism, and place great importance on astrology. Important state functions are held according to the auspicious times chosen by astrologers.