Gisela Mota, 33, a left-of-center former member of Congress, was gunned down barely 24 hours after taking her oath of office in the city of Temixco, which is about 90 kilometers (55 miles) from the capital Mexico City.
Temixco is plagued by organized crime and rampant drug trafficking — problems the slain mayor had vowed to help clean up.
The government of central Morelos state said that two of the suspected gunmen had been killed and one was in custody.
State Governor Graco Ramirez pledged there would be “no impunity.”
Morelos has been one of the Mexican states most affected by drug violence plaguing the country, including kidnappings and murders.
More than 100,000 people have been killed or gone missing in a nearly a decade of drug violence nationwide.
Mexican President Enrique Pena Nieto, who took office in December 2012, has pledged to reduce the murders, kidnappings and extortion haunting Mexicans.