Prosecutors are investigating how a man was elected mayor of a village in southern Mexico three years after he was certified dead.

Authorities say relatives of Lenin Carballido used a death certificate showing that he died of a diabetic coma in 2010 to convince police to drop an arrest warrant against him for allegedly participating in a 2004 gang rape.

A living Carballido later ran in, and narrowly won, Sunday's election in San Agustín Amatengo in Oaxaca state. In his campaign, he posted photos of himself all around the village of 1,400 residents, with slogans such as: "Now is the time," and: "United for development."

But shortly after his victory, the death certificate surfaced with his full name of Leninguer Carballido.

Officials in Oaxaca said on Thursday that the certificate had been drawn up and signed by a public registry official, but that the information had been faked.

Carballido's party, the leftist Democratic Revolution party, known as the PRD, said it had been fooled by the candidate.

"When he registered as a candidate, he presented all his paperwork, his birth certificate, a letter stating he had no criminal record," said Rey Morales, the state leader of the PRD. "He fooled the prosecutors' office, he fooled the office of records, he fooled electoral officials."

"If all this is true, he cannot take office as mayor," said Morales.

Carballido did not answer his phone on Thursday.

Haydee Reyes Soto, the director of the Oaxaca public records office, said the registry official who drew up the fake death certificate had used a real official form, signed it and stamped it with an official seal, and even listed it under a file number used to record a real death.

"The form is real. What is false is the information," Reyes Soto said, adding that "the decision has already been made to fire" the official, Abel de la Rosa Santos, who is also being questioned by prosecutors.

According to records, a woman accused Carballido and four other men of having raped her in Oaxaca city in 2004.

Mayra Ricárdez, spokeswoman for the Oaxaca state prosecutors' office, said the arrest warrant against Carballido was "never served, because his family showed officers a false death certificate".

Ricárdez said the statute of limitations had not run out on the crime.

"The prosecutors' office is taking all the legal steps necessary to revive the case and serve the arrest warrant that is still pending," she said.

It seems unlikely that Carballido will be able to take office in San Agustín Amatengo, an impoverished village near the city of Oaxaca where many residents left in the 2000s to seek work in the United States and elsewhere.

One San Agustín Amatengo official, who said he could not speak on the record about a criminal case, said residents had not been aware of the candidate's past; the rape did not take place in the village.

"All of this came out after the elections were over," the official said.

On Thursday, the Oaxaca state prosecutors' office issued a statement saying it would do everything it could to put him in jail, even if he is formally sworn in as mayor, and was considering whether he might also face charges on election-law violations.

"The state attorney general's office will investigate and bring charges, even if the suspect is recognised by electoral authorities as a municipal authority," the office said, referring to him by his full name, Leninguer Raymundo Carballido Morales. He ran for office simply as "Lenin Carballido".