MEXICO CITY (AP) — Mexico’s military will take over the country’s land and maritime ports of entry as President Andrés Manuel López Obrador tries to root corruption out of the country’s customs offices.

“We have made the decision, I’ve just advised the security Cabinet, that the land and maritime customs (offices) are going to be in the charge of the Army and the Navy and the same in the case of the country’s ports so that there is security and to avoid the introduction of drugs,” López Obrador said Friday from the Pacific port city of Manzanillo, Colima.

The military had already worked in a supporting role providing security at some ports of entry, but Friday’s announcement appears to place far more responsibility with the generals. The move is in line with other situations in which the president, when faced with deep-rooted corruption, has turned to the military.

The military is already leading the fight against theft from Mexico’s fuel pipelines, building a new airport for Mexico City, contributing the bulk of personnel to the new National Guard and constructing hundreds of bank branches for the government’s social welfare agency.

López Obrador said the change was necessary to “save customs.”

The military will work in “coordination” with the customs agency, said customs administrator Horacio Duarte.

The objective is to stop the flow of drugs, guns and cash, as well as increase the payment of customs duties, Duarte said. Customs and military will coordinate under the Tax Administration Service. López Obrador put Duarte in the position earlier this year to clean up the corruption in customs.

The announcement came on the final day of López Obrador’s tour of three of Mexico’s most violent states.