A group of indigenous Mexicans kidnapped two lawmakers in the southern state of Chiapas, held them overnight and finally freed them unharmed Thursday after the state congress agreed to replace the mayor of their town.

Legislative President Eduardo Ramirez Aguilar and his colleague Carlos Penagos had met with angry Tzotzil Indians on Wednesday in the cathedral of the city of San Cristobal de las Casas to discuss their grievances against then-Mayor Rosa Perez.

However the group forcibly took the lawmakers into custody and brought them to their highland hamlet of Chenalho, roughing up some aides and damaging cars in the process. Townspeople tied the men up in a kiosk and threatened to kill them if no agreement was reached.

Ramirez and Penagos were released after the state congress announced that it was installing a new mayor and opening an investigation into Perez.

A state police official who was not authorized to discuss the case publicly and spoke on condition of anonymity said the officials were in good health and back with their families in Tuxtla Gutierrez, the state capital.

The Tzotzil group accuses Perez of corruption, abuse of power, diverting resources for personal enrichment and failing to complete community construction projects.

Perez, the second female mayor to be forced out of office in Chiapas recently, has accused her detractors of not "tolerating that a woman would govern in a traditionalist town where by practice and custom men are usually in command."

Political analyst Carolina Rodriguez said the conflict in Chenalho owes much to the fact that "it's a woman, not a man, who is in charge, and in a region where machismo and religious customs persist, they will always be against women occupying important public positions."

The newly designated substitute mayor, Miguel Santiz Alvarez, is a man.