MEXICO CITY, Oct. 19 (CGTN) -- Mexico's foreign minister said on Saturday that President Andres Manuel Lopez Obrador and his U.S. counterpart Donald Trump had agreed to take swift action to stem the flow of illegal weapons from the United States into Mexico, where a drug war is raging.

Lopez Obrador told Trump on a phone call that he proposed both countries use technology to close the border, to freeze the traffic of arms that is killing people in Mexico, said Foreign Minister Marcelo Ebrard.

And Trump responded that he thought it was a good idea that this could be done using technology, said Ebrard, adding that the idea is to install at all border crossings advanced lasers, X-rays and metal detectors, capable of even detecting chemical products.

Not only could that staunch the flow of illegal weapons into Mexico, but also the trafficked drugs into the United States, said Ebrard.

Increasing the number of Mexican intelligence agents in the United States is another proposal that is on the table.

Lopez Obrador told Trump "he was very concerned" that gang members used .50 caliber, armor-piercing rifles during the breakout of violence in the northwestern city of Culiacan over the attempted arrest of Ovidio Guzman, a son of jailed drug lord Joaquin "El Chapo" Guzman.

Mexico estimates that upwards of 80 percent of the weapons used by criminals in Mexico enter from the United States, and has long lobbied U.S. officials to take gun trafficking more seriously, arguing that the number of guns in the country make it much harder to clamp down on drug traffickers.

Ebrard assured there was no need to change laws in the United States in order to stop the illegal flow of weapons into Mexico.

Gun control of any kind is a hot button issue in the United States ahead of 2020 elections and could face resistance from the gun lobby, especially the powerful National Rifle Association lobby group which has strongly resisted restrictions after recent U.S. mass shootings.

The two leaders agreed that U.S. and Mexican officials would meet in the next few days to discuss options, and would announce actions to "freeze" illegal imports of weapons into Mexico through U.S. border crossings.

The discussion came in the wake of the bungled arrest attempt. Cartel gunmen surrounded about 35 police and national guard on Thursday in the capital of Sinaloa state and made them free Ovidio Guzman. His brief detention had set off widespread gun battles and a jailbreak that stunned the country.

"If the order would have been given to continue with the operation in Culiacan we estimate that more than 200 people, mostly civilians, would have been killed," said Ebrard, adding that so-called collateral damage was unacceptable to the Mexican government.

The chaos in Culiacan, a bastion of the elder Guzman's Sinaloa cartel, has turned up pressure on Lopez Obrador, who took office in December promising to pacify a country weary of more than a decade of gang violence.

Admitting that the cartel's response was faster than what authorities expected, Ebrard said valuable lessons were learned from the failed attempt to capture the Guzman son.

Ebrard said Mexico's armed forces need better training and technology, underscoring that there is still an "outstanding arrest warrant for Ovidio Guzman and other people and the corresponding authorities have to do what is necessary" to carry out the arrests.