The temple’s car park appeared to be on fire, but it was alright because the shamans had it under control. In fact, they’d lit the fires in the first place, for the pilgrims, who were taking part in a shamanic ceremony to vanquish themselves of negative energy; a curious ritual that also involved drinking rum and smoking cigars.

I was visiting the Temple of San Simón in San Andres Itzapa, a small town in the Guatemalan Highlands. This is a pilgrimage site for many Mayans, who come from across Central America to pray at the altar of San Simón, a morally ambiguous deity also known as Maximón.

You may also be interested in:
• Where cars are blessed with beer
• Where people speak the Aztec language
• The descendants of a super human race

Beneath the temple’s veil of spiritualism, I detected a seedy, vaguely sinister, atmosphere. Among the families and elderly devotees were groups of hardened young men and women, who looked like they could probably help the police with their enquiries.

“You get a lot of prostitutes and drug dealers coming here,” whispered my guide Karen Ayala, though she added that most pilgrims are good, honest folk.

Some worshippers, I noticed, were swigging beer, purchased at the on-site liquor store, or ‘cantina’, which does a roaring trade in rum and tobacco. Alcohol, I learned, has long been used in Mayan ceremonies because it is thought to help worshippers ‘reach a trance-like state’ (also known as being drunk); cigars and cigarettes, meanwhile, said Ayala, represent “tunnels between the past and future.” There was something prophetic about the way they burned, she added.

The temple was fascinating, and I paused outside to take it all in. I watched bandana-wearing fortune tellers tout their talents to recently arrived pilgrims, competing with souvenir sellers who plied their trade in ecclesial keyrings and necklaces.

Scampering across the scene were stray dogs, which paused every so often to scratch flea bites or cock a leg against the parked cars, a motley collection of clapped-out sedans and blacked-out SUVs with shiny alloy wheels.

The air was heavy with smoke. I could smell incense, tobacco and cypress needles, a carcinogenic cocktail tempered by the sweet scent of smouldering sugar, which was used as the base of the ceremonial fires. Ayala and I escaped the fumes and entered the blue-and-white temple. Inside, hundreds of devotees stood in line, waiting to worship an effigy of San Simón, which sat almost regally on an altar at the head of the church.

San Simón is a god with vices

Dressed in a black suit, black tie and dark brown sombrero – with a heroic, handlebar moustache – the effigy had a cowboy-cum-gangster aesthetic that jarred with the nearby statue of a wholesome-looking Virgin Mary.

Worshippers climbed the steps to San Simón’s altar, talking to him in Spanish and various Mayan tongues, while dousing his effigy in rum and placing tobacco onto his lap. San Simón, evidently, is a god with vices.

Curiously, there was a plastic veil hanging over the deity’s face, which, according to Ayala, was there to stop overzealous pilgrims placing lit cigarettes into his mouth – a definite fire hazard with all that rum sloshing about.

The pantheon of the ancient Mayans contained a vast collection of deities for every aspect of human life: there were gods for birth and death, war and peace, sickness and health.

That much we know. Our wider understanding of the Mayan pantheon, however, is limited, because when Spanish conquistadors arrived in modern-day Guatemala they destroyed written references to indigenous deities. There was only one religion, they reasoned, and that was Catholicism.

“Catholicism was imposed on the Mayan people, but they never let go of their religion,” Ayala explained. “They fused both religions together.” Hence, she added, why the temple also has a statue of the Virgin Mary.

Few Mayan gods survived the conquest, and some scholars believe San Simón has taken on the characteristics of numerous lost deities. Consequently, there are myriad interpretations of his character, although most worshippers seem to believe that he’s a god who grants wishes.

To get an idea of the kind of favours people ask San Simón for, I read some of the ‘thank you’ messages that festoon the temple walls. Some were written on dog-eared sheets of paper, others etched into bronze or marble plaques.

“Gratitud al hermanito San Simón por haberme salvado de haber ido mucho tiempo ala carcel,” reads one, which translates: “Gratitude to the brother San Simón for saving me from having gone to jail for a long time.”

It’s not the only plaque offering thanks for an early release, though most messages seem to praise San Simón for material possessions such as cars and houses. These jar somewhat with the notes expressing gratitude for healing sick relatives.

I chatted to one worshipper, who gave his name as Byron. He had 12 members of his family in tow, including two small children.

“We’ve come to thank San Simón because he helped us find work,” said Byron, who brought flowers for San Simón, rather than cigarettes and alcohol. “We drove two hours to get here. We come every year.”

The Guatemalan Highlands are the spiritual home of San Simón. In most villages where he is worshipped, his effigy moves from house to house; according to Ayala, the Temple of San Simón is his only permanent shrine.

San Simón has a reputation for mischief. Legend has it that he was asked by a group of fishermen to prevent their wives from having affairs while they went out to work. Depending which side of the story you believe, San Simón was either a successful saboteur of adulterous behaviour or a trickster who abused his position to sleep with the fishermen’s wives.

The deity exists in something of a moral grey area, which makes him popular with those living on the wrong side of the law

Such myths have served to shroud San Simón’s character in ambiguity, and today the deity exists in something of a moral grey area, which makes him popular with those living on the wrong side of the law.

It is in this moral grey area that the temple’s black magicians also operate. Working in a litter-strewn courtyard next to the church, these practitioners eke out a living by putting ‘spells’ on people.

“It could be a spell to make someone fall in love with you or a curse on your enemy,” Ayala explained.

In the courtyard we met John, who is paid by the magicians to bury glass bottles containing spells – thus binding them – along with photographs of their intended subjects. John is 12 years old.

“I do this at weekends,” said the spiky-haired youngster, leaning on a shovel. “With the money I get, I buy things that I need for school.”

We didn’t linger long with John because a black magic ritual started taking place nearby, which seemed to involve tins of sardines being thrown into a fire. I feared being splattered with sizzling fish oil.

“When the cans explode it means a curse has gone away,” Ayala explained, as, right on cue, a can burst.

The highlands of Guatemala are blighted by poverty, and many people living in the region, and beyond, turn to San Simón for salvation.

One such person is Chaguita, a 62-year-old hawker, who was selling San Simón souvenirs – keyrings, necklaces and the like – outside the temple.

“I have been selling souvenirs here for more than 30 years,” she said, her diminutive frame bent over from the weight of her wares. “I suffered a stroke, but I walk for an hour to get here every day.”

Chaguita prayed to the deity from her hospital bed and believes he helped give her the strength to make her souvenir business a success.

“I pray to San Simón to help me sell my things,” she explained, as I bought a keyring of the moustachioed god. “Everything I sell is a blessing from San Simón.”

And with that, Chaguita was off, touting her wares to the gathering pilgrims as the car park continued to burn.

Join more than three million BBC Travel fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Future, Earth, Culture, Capital and Travel, delivered to your inbox every Friday.