The animals, reacting to the loss of their forest habitat and a scarcity of food, frequently invaded the farmland around the village, trampling on plants and crops and destroying incomes.
Everything the villagers tried to deter the animals - digging trenches, beating traditional drums, installing solar-powered electric fences, or planting shrubs with supposed repellent qualities - proved ineffective. One after another, residents began to give up farming.
But the situation has turned around in the past year. Now people in Mayilattumpara are no longer disturbed by elephants. Instead they are agreeably surprised by visiting herds of journalists, scientists and environmentalists.
That's because residents have finally figured out what repels elephants: honey bees.
A wire fence strung with beehives now stretches 2.5km (1.5 miles) along the border of 18 village farms. The hives, hanging every 10 metres along the wire, are populated with Italian honey bees bred in Kerala.
Elephants, it turns out, are frightened of loudly buzzing bees and their ferocious stings. When elephants try to pass the wire fence, angry bees swarm out and the elephants quickly flee, residents say.
Protected by the bees, farmers can tend their crops again. And some are also beginning to cultivate a new harvest - honey.
Johny Kochery has 9 hectares (22 acres) of farmland in Mayilattumpara, but for a time gave up trying to produce crops after repeated damage by elephants. Now he points to flourishing coconut trees, rubber plants and more than 60 varieties of fruit on his land.
Since installing the beehive fence a year ago, "not even a single elephant reached the vicinity of my farm. Elephant attacks are an old story," he said.
During the recent monsoon season, elephant herds crossed the nearby Peechi reservoir and raided the neighbouring villages of Kalladik, Thekkumpadu and Poolachode, trampling plantain trees and destroying villagers' huts.
But they haven't come any closer than 100 metres to the beehive fence protecting Mayilattumpara, residents say.
The fence project, begun in January 2016 by a local farmers' group with the support of the federal government's Agriculture Technology Management Agency (ATMA), cost Rs 5,00,000.
VS Roy, who initiated the project while working for ATMA, said the idea came from the work of Lucy King, an Oxford University researcher who in 2008 successfully tested using African honeybees to keep elephants at bay in areas of Kenya where there was conflict between the animals and people.
The experiment was later repeated by other researchers in Tanzania.
"If it could (work)in the African forest, why couldn't it in the Kerala forest?" Mr Roy remembers thinking.
According to India's environment ministry, conflict between humans and elephants across the country leads to regular deaths among both.
Last year the state's forest department paid more than Rs 90 million in compensation for loss of life and destruction of property caused by elephants, officials said.
Problems - and profits
VS Roy's project was not an initial success. An experiment in 2012, in another district, failed in part because he did not first get sufficient support from local people, he said.
When he came to Mayilattumpara, he started the farmers' association and involved them in the planning to win their backing and participation, he said.
Johny Kochery, who heads the farmers' association, noted that setting up such a system is not easy "unless farmers are ready for collective, meticulous and patient experimentation".
Besides figuring out an effective fence and hive system, farmers also had to learn to manage bees and replace colonies that become diseased, and pick up the costs of doing that once initial grant money from ATMA ran out, he said.
None of that has been easy, he said.
But today the effort is beginning to pay off. Each December to March honey season, each of the 260 beehives strung along the fence could produce as much as 30 kg of honey, farmers said.
This has the potential to bring in up to Rs 65,000 rupees for each farmer, allowing for a substantial profit even after the costs of maintaining the hives.
That has not yet happened, and Mr Kochery said the farmers only broke even last season due to some initial glitches - but they hope to have a big harvest this year.
Despite the challenges, farmers from other areas of human-elephant conflict in the state now hope to replicate the Mayilattumpara effort, and win financial support from the state's Forest and Wildlife Department.
"It should be scientifically sustainable. We are awaiting reports from on the ground," said Nagesh Prabhu, the state's head of forest conservation.
Kerala's government is also trying to defuse conflict between elephants and people by reducing deforestation and rehabilitating elephant habitat, officials said.
In the meantime, EA Jayson, a scientist with the Kerala Forest Research Institute, which has completed a study of the beehive fence experiment, said the fencing seems to work - but there are now new problems to solve.
"Rather than technical issues, some social issues are creating hindrances. We have met with incidences of theft of beehive boxes," Mr Jayson said.