A political candidate shot dead at a campaign rally last month has been elected mayor of a town in western Mexico.

Enrique Hernández was caught in a hail of bullets fired from a moving vehicle on May 14 as he delivered a stump speech to a crowd of supporters in Yurécuaro, Michoacán. He had repeatedly accused the government of kowtowing to the Knights Templar drug cartel in the area. Three local law-enforcement officials were charged in connection with the murder, including the director of public safety of Yurécuaro.

Before Hernández was a candidate, he was the leader of a movement for armed self defense against the Knights Templar drug cartel in Yurécuaro. He was also an unsparing critic of official corruption who went so far as to single out by name the former governors of Michoacán, Fausto Vallejo and Jesus Reyna Garcia, as examples of officials who “permitted, authorized, and coordinated” cartel atrocities like extortion, murders, and despoiling of private land. He described the state government as working “in coordination” with the cartel and said the municipal government was infiltrated at every level.

Hernández was not the only candidate murdered in the 2015 Mexican election cycle. There were eight altogether. But unlike many of the others, his name stayed on the ballot—and he won. The preliminary count after last Sunday’s vote showed him with a comfortable margin, 10 percentage points higher than his nearest rival.

The mayoral race in Yurécuaro may be the first case in modern Mexico of a candidate winning an election from the grave, but his post in city hall will not be left vacant. In Hernández’s place, the office of mayor will be filled by Marco Antonio González, who after the murder had pledged to “go out and continue the campaign, making it clear that a vote for us is not a vote for a party slate but for the ideals of a man, Enrique Hernández.”

For 20 years, Yurécuaro has been the bastion of two political parties, the Institutional Revolutionary Party (PRI) that totally dominated the country’s political life for most of the last century, and the left-of-center opposition Party of the Democratic Revolution (PRD). Hernández publicly accused both of cultivating an environment of corruption and giving free reign to organized crime in the contentious border zone between the states of Michoacán and Jalisco.

Cartel-linked violence in the region escalated in the weeks before and after his assassination. On May 1, a Mexican Army Special Forces helicopter was downed by a rocket-propelled grenade just across the border in Jalisco; six soldiers riding on board were killed in the attack. On May 22, 42 alleged members of a drug cartel were killed in a government raid on a private ranch a short distance from Yurécuaro in Michoacán. The Guardian reported the death toll was the highest yet from a confrontation involving Mexican security forces.

Hernández was the candidate for Morena, a left-wing political group formed in a split from the PRD and led by two-time presidential candidate Andres Manuel López Obrador. Morena is an acronym for the Movement of National Regeneration, and Sunday was its electoral debut. Preliminary results estimate Morena won between 34 and 40 seats in the Congress, a strong debut in an election that saw significant declines for the more established opposition parties, the PRD and National Action Party (PAN).

Nationally, nearly 5 percent of voters chose to 'vote no' by casting a blank ballot to register a general lack of confidence in the elections. Resentment over issues of official corruption and the impunity of officials at all levels of government continues to fester, as exemplified by the case of 43 students from a rural teachers college still missing after they were abducted by municipal police on March 26 in Iguala, Guerrero.

“We must be conscious of the fact that to rebel against the lawlessness of the Knights Templar we must at once rebel against the state government that supports them,” Hernández said in an interview from September 2014 that is available on YouTube.

Hernández appears before the camera as a plain-spoken, unassuming, middle-aged man in large science-teacher eyeglasses, a golf shirt, and a straw hat. He says the self-defense movement arose to combat extortion and land theft. In his own case, he recalled the cartel's attempt to extort from him a payment of more than $25,000. He said law enforcement officials in town took no interest in his case apart from advising him to “come to an arrangement” with the cartel, and the Federal Police declined to get involved, telling him it was beyond their jurisdiction.

Hernández also clashed with the federal government after President Enrique Peña Nieto placed Michoacán in trusteeship and appointed a prosecutor named Alfredo Castillo to administer justice. Hernández said of the presence of the Mexican Army and Federal Police in the state, “It is known, and I mean very well known, that the criminals pay the authorities to make the system operate in favor of the criminals.”

Hernández said he rejected an overture from Castillo in the form of money and what he called “total impunity” in exchange for bringing the self-defense forces of Yurécuaro into the fold.

In March 2013, Hernández and 19 of his men were arrested and held in a maximum-security jail for three months on a murder charge. A judge ultimately dismissed the case against him for lack of evidence. He said the arrest was a form of retaliation for his refusing to cooperate with Castillo.