I ended up in jail in the Philippines earlier this week.

While visiting Iligan, a major city in the southern island of Mindanao, I got an invitation to meet the local chief executive.

The meeting was to take place not in the mayor's office but in a prison compound.

The mayor has been holding office inside a prison for almost seven months now.

He has been accused of ordering an ambush that left three bodyguards of a political rival dead.

As a former police chief he finds the situation ironic, he told me.

Philippine voters seek safety and security

But he is running for re-election anyway, vowing to fight crime and get rid of "corrupt" local officials, in a similar manner to the candidate he is supporting for president - frontrunner Rodrigo Duterte, another mayor from Mindanao.

Around 55 million Filipinos head to the polls on Monday to elect a new president.

A total of 18,000 national and local positions are being contested, attracting 44,000 candidates. 

The simultaneous races create a nationwide political atmosphere that is a cross between a religious festival, a Ringling Brothers circus and a Kardashian TV show, with a bit of gangland brutality.

So far, 15 people have been killed in election-related violence, including a candidate for mayor who was shot dead in front of his family on Saturday.

From Imelda Marcos to boxing legend Manny Pacquiao, it seems everyone is running for office in the Philippines.

To name just three, the convicted former president Joseph Estrada, who is 79 and is seeking a second term as mayor of Manila; a senior Catholic clergyman in Mindanao; and a scion of a northern political clan, who could be the first transgender member of the Philippine Congress.

An AFP news agency report has listed a number of other Filipino politicians running while in prison.

Imprisoned mayor

Only two days ago, a court in western Philippines granted bail to a local candidate who was the main suspect in the killing of a journalist and environment advocate on Palawan island.

Meeting the imprisoned Iligan mayor seemed mild in comparison.

I could not say no to the offer, especially after prison officials imposed a media blackout and barred journalists from talking to him during the campaign season. 

But I knew why I got the unsolicited invitation: The mayor and I have the same last name.

The detained mayor of Iligan City said he was being unfairly targeted by his political opponents [Ted Regecia/Al Jazeera]

Inside the prison, Mayor Celso Regencia, who I've never met before, presided over a circle of aides handing him folders of government documents for signature.

Sitting in a makeshift office outside a bamboo hut with palm roof, he chatted with supporters who paid him a visit and delivered the latest political gossip.

To get to his corner in the jail compound, I had to pass through two security checks, not counting the barricades set up by hundreds of his supporters in red shirts.

I was told to wear red to expedite entry. I politely refused.

Sweat flowing freely

Prison air was thick and sweat was freely flowing down my face as I nervously eyed hundreds of men packed in a two-storey building behind bars without air-conditioning.

They stared back uneasily.

Other prisoners in basketball uniform freely roamed the compound, while a group of female detainees walked around, chatting and holding hands.

Everyone was minding their own business.

The mayor of Iligan is supporting the presidential candidacy of Rodrigo Duterte, a mayor of Davao also in Mindanao [Ted Regencia/Al Jazeera]

A group of men were busy stirring a pan, while one prisoner tried to scoop hot water from a boiling pot using a plastic pitcher.

Another was busy taking photos with his camera.

Confronted with the deadly ambush allegation against him, Regencia said he was framed by his political enemies who felt threatened by his brand of governance.

He also dismissed reports linking him to several unsolved killings in Iligan, saying those cases had been "dismissed" by prosecutors.

He said he had never ordered police to kill suspected criminals in the city, although he laced his statements with a promise to go after criminals and "cut their hands off".

'Duterte of Iligan'

Supporters openly referred to Regencia as the "Duterte" of Iligan. 

"This is really tough for me and my family," Regencia said of his extended time in jail and the allegations against him. As he railed against his opponents, he continuned to munch from a small bag of roasted peanuts.

Before our time was up, Regencia offered his guests some cheese rolls and orange soda, as he predicted his political adversity would be over soon, hinting at a possible victory of Duterte in the presidential race, as well as his own in Iligan.

Then he coyly declared: "I'm also well qualified to be the next interior minister" for the next president.

Welcome to Philippine politics.

A wildcard election in the Philippines

Source: Al Jazeera