President Felipe Calderon appealed to Mexicans to support the fight against organised crime in a national TV address hours after troops killed 15 suspected gang members.
The crackdown was part of a surge in violence that could make June the deadliest month yet in his drug war.
In his televised message, Mr Calderon urged his countrymen to report criminals to authorities and help defeat brutal drug cartels. A phone number for anonymous tips flashed on the screen as he spoke.
"This is a battle that is worth fighting because our future is at stake," Mr Calderon said during the 10-minute speech. "It's a battle that, with all Mexicans united, we will win."
The message came a day after Mr Calderon published an essay in national newspapers defending the crackdown on cartels, a fight that has seen more than 23,000 people killed since late 2006 when he began deploying thousands of troops and federal police to drug hot spots.
Mexican officials attribute much of the bloodshed to turf battles between drug cartels, but the gangs are increasingly turning to attacks on police and prosecutors.
"To recover our security won't be an easy or quick task but it's worth continuing," Mr Calderon said in the speech. "My government can't and won't let its guard down."
Before he spoke, soldiers investigating suspicious activity came under fire from gunmen holed up in a house in the tourist town of Taxco in Guerrero state.
The Defence Department said no soldiers were hurt in the 40-minute shootout that left 15 gunmen dead. Twenty guns and two homemade explosives were recovered.
Taxco police said the men killed were suspected of being tied to Edgar Valdez Villarreal, a reputed US-born crime boss known as La Barbie. Mexican security forces have detained several alleged Valdez henchmen recently.
Taxco is popular with foreign visitors because of its colonial architecture and more than 2,000 silver shops, but it has increasingly been the scene of cartel turf battles. Two weeks ago, authorities discovered 55 bodies in an abandoned Taxco silver mine that was being used as a dumping ground for apparent victims of drug violence.
Tuesday's battle came a day after 12 federal police officers were killed in an ambush in neighbouring Michoacan state, a stronghold of drug activity. It was unclear if the two shootouts were related.
Federal police anti-drug chief Ramon Pequeno blamed the attack on the Michoacan-based La Familia, a cartel that has become notorious for bold assaults on federal security forces.
Also on Monday, gunmen killed three federal officers in the northern city of Chihuahua, and inmates at a prison in northern Sinaloa state used guns apparently smuggled inside to kill 21 prisoners in what officials said appeared to be a dispute between gangs. At least eight more inmates were later stabbed to death in apparent reprisals at the same prison.
The dozens of deaths on Monday and Tuesday followed a particularly bloody pair of weeks. Last week, gunmen killed 16 people in one day in the northern city of Ciudad Madero, and attackers burst into a drug rehab centre in Chihuahua and shot 19 men to death.