MEXICO CITY — Mexican President Andrés Manuel López Obrador defended his security strategy on Tuesday and blamed past administrations for chronic violence, a day after at least 13 police were killed in an ambush by suspected cartel gunmen.

López Obrador told a news conference the ambush in the western state of Michoacán was "very regrettable" but reiterated that his commitment to increased spending on security and tackling the root causes of violence would eventually pay dividends.

"I'm optimistic we'll secure peace ... we're completely dedicated to this issue, but (past governments) allowed it to grow. There's a new security model now," Lopez Obrador said, describing the site of the ambush as a "violent area."

The leftist leader has sharply criticized past efforts that pursued an army-led approach to battling crime.

But after a record number of homicides in Mexico in 2018, they are on track to go even higher this year, putting López Obrador under increasing pressure to stop massacres like Monday's ambush in the violent western state of Michoacán.

He hopes his welfare schemes, including youth scholarships and apprenticeships, will help draw people away from crime.

Photos of the crime scene published on social media showed bullet-riddled police vehicles set on fire, as well as the bodies of slain officers on the ground.

They also included placards left on vehicles brazenly signed by Jalisco New Generation Cartel, one of Mexico's most powerful gangs, warning police not to support rival outfits.

Federal authorities said 14 police were killed, while Michoacán officials reported that 13 officers died.

Around 80 soldiers and an army helicopter have been dispatched to investigate and find the perpetrators, Gen. Luis Sandoval, the defense minister, told the news conference.

Alongside him, Mexican Security Minister Alfonso Durazo said the use of force is a legitimate government tool to deal with lawlessness, but should only be considered as a last resort.

"We will pacify the country without using violence, without repression," Durazo said.

After taking office in December, López Obrador created a militarized National Guard police force to contain the violence.

But many of the National Guard have instead been deployed to police Mexico's borders to placate U.S. President Donald Trump, who has threatened to impose tariffs if López Obrador does not reduce the flow of U.S.-bound migrants from Central America.

Follow NBC Latino on Facebook, Twitter and Instagram.