MEXICO CITY — When a young corporal in the Mexican marines was ambushed by drug cartel gunmen in the state of Tamaulipas, his first thoughts were for his pregnant wife and unborn child.



But within a split second, he was focused on combat, as his unit took defensive positions around their convoy to return fire.

They managed to shoot dead four attackers while only suffering two injuries.



The victory — one of many by Mexico’s marines — was helped largely by U.S.-supplied equipment and training with the U.S. Northern Command in Colorado.



“We have learned from American officers who have fought in Iraq and Afghanistan,” said the corporal, who asked that his name not be used as he is not authorized to speak to the media.

“The Americans suffer from similar types of ambushes in their wars, and have learned how to respond to them in a tight, disciplined way. We apply those techniques to our fight here.”



Extensive training of the Mexican marines is one of several ways in which the U.S. military machine has quietly escalated its role in Mexico’s ultra-violent drug war in the last two years.

More from Mexico: Drug war on the silver screen



The U.S. has also supplied Mexico with state-of-the-art military hardware, including Black Hawk helicopters and surveillance drones.



Furthermore, CIA operatives and American military contractors were recently posted at a Mexican military base to advise directly on operations, according to the New York Times.



The question of U.S. military involvement in Mexico came into the national spotlight this week after Republican presidential hopeful Rick Perry contemplated American troops shooting it out with cartel hit squads.

Related: Cartel violence escalates



“It may require our military in Mexico working in concert with them to kill these drug cartels and keep them off our border,” Perry said.



Mexico’s ambassador to the U.S. swiftly responded saying that “U.S. troops on Mexican soil is not on the table.”



But few in the U.S. are aware how entrenched their military machine has already become south of the Rio Grande.



The rising American presence has caused consternation in Mexico, a strongly nationalist country that annually celebrates the ninos heroes, child soldiers who died fighting the U.S. in 1847.



Some commentators here say new American involvement violates Mexico’s constitution.



Political analyst Jose Antonio Crespo argues that the United States is supporting a war that simply doesn’t work.



“Launching a frontal combat against all the drug cartels at once is just causing more violence and not getting to the roots of the problem,” Crespo said. “The United States encourages this failed policy. And then it gets concerned by all the violence it causes.”



However, Crespo concedes that the U.S.-trained marines have become the most efficient force in the Mexican military.



Directed by Mexico’s Navy Department, the marines have been increasingly favored by U.S. officials over the last two years.



In one diplomatic cable uncovered by Wikileaks, former ambassador Carlos Pascual praised the marines for their “emerging role as a key player in the counternarcotics fight.”



Following training with the U.S. Northern Command, the marines have shot dead several major cartel bosses, including Arturo Beltran Leyva, alias “The Beard” and Ezequiel “Tony Tormenta” Cardenas.



On Wednesday, the marines took charge of a security operation in the port of Veracruz, where thugs dumped 35 corpses on a road during rush hour last month.



The Mexican marines are helped by the fact that most have a higher level of education than those in the Mexican army or federal police, the marine corporal said.



“We are considered to be the yuppies in the Mexican military,” he said. “Me and most of my colleagues have university degrees. A lot of regular soldiers come from poor villages and left school when they were 16.”



The Mexican marines are also considered much less corrupt than their counterparts, because they traditionally have been uninvolved in the drug war — and have had less contact with the tempting offers of billionaire traffickers.



However, the analyst Crespo fears that as the marines take to the frontline, they could become more compromised — and U.S. training and equipment could fall into the hands of the gangsters.

At least one member of the feared Zetas gang had received U.S. training while working as a Mexican soldier before he defected to the cartels, according to another embassy cable uncovered by Wikileaks.

"It is impossible to guarantee that every Mexican soldier who receives our training in the future will not defect to organized crime," that cable said.

"We remain hopeful however, that the passage of harsh legislation instituting a 60-year sentence for soldiers who become involved in organized crime will be a useful deterrent."

Many in Mexico are less optimistic.

"As the marines are stationed in more areas where drug cartels are strong, there is high risk they could be contaminated — just like the army and police,” Crespo said. “And then who can we turn to?"