(CNN) The mayor of a town in the Mexican state of Oaxaca was killed less than two hours after taking office, the state attorney general's office said.

Alejandro Aparicio had just been sworn in as mayor of Tlaxiaco on Tuesday and was on his way to a meeting at city hall along with some of his colleagues when a man opened fired and struck him, the office said.

Aparicio and at least three others were rushed to a hospital, where the mayor was pronounced dead. He died of internal bleeding after suffering a gunshot wound that punctured his right lung, the attorney general's office said.

Another local official who was injured during the attack died Wednesday morning. Two other people who suffered gunshot wounds were still being treated Wednesday, officials said.

Aparicio had been touring several city offices and was surrounded by supporters when he was shot on the street.

Read More