Alejandro Aparicio Santiago had just been sworn in the indigenous town of Tlaxiaco in the state of Oaxaca on Tuesday morning when two men approached started shooting at him and three other politicians.
Aparicio Santiago was traveling to the a meeting a city hall at 11.30am when he was attacked by the two gunmen, according to the state prosecutor's office.
Villagers quickly jumped into action and apprehended one of the suspects, who has not been identified.
They beat the suspect and detained him before police officers arrived.
Law enforcement is still searching for the second suspect in the town of 40,000 residents.
The wounded mayor was immediately transferred to a hospital wing of the Mexican Social Security Institute where he died from the gunshot wound he suffered in his chest during the brazen attack.