Mexico said on Wednesday it was close to charging police officers with deliberately targeting two U.S. agents in an August attack that caused serious embarrassment to the Mexican government.

Security officials identified the men as CIA agents, and Mexican investigators have said the attack may have been carried out by corrupt police working with drug gangs.

The incident, which police first blamed on a case of mistaken identity, was the worst attack against U.S. officials in Mexico since drug gang hit men killed a U.S. immigration agent and wounded his colleague in a highway attack in early 2011.

Mexico's attorney general said police were likely to be prosecuted for the ambush of the two agents as they traveled in a vehicle with diplomatic plates on a road south of Mexico City.

"At the moment everything points to the fact that there will be people to charge," said attorney general Maries Morales. "We're now carefully analyzing the conduct of each officer to ascertain what exactly they can be charged with."

The CIA has declined to comment on the incident. Mexican authorities have detained 14 people in connection with the case.

Cooperation between U.S. and Mexican forces has increased since Mexican President Felipe Calderon launched a military offensive against drug cartels in late 2006.

A greater number of U.S. security officials have been discretely working in Mexico to aid in Calderon efforts as the battle between warring drug gangs and the government escalated. More than 60,000 people have died in the violence since 2007.

According to security experts, U.S. intelligence officials have developed strong ties with the Mexican Navy, which has scored a string of recent high profile takedown of drug lords.

The ambushed CIA operatives - who were on their way to a Mexican military base accompanied by a Mexican marine captain when they were attacked - received non-life threatening injuries and quickly left Mexico. The police officers said in statements that they confused those inside the car for criminals.

Nonetheless, Mexican officials have said the evidence suggested gang members worked alongside police in the attack, noting that the officers' use of AK47s and the fact that they were not wearing uniforms suggested a targeted cartel hit.

Mexican police are frequently implicated in violent crimes, as drug cartels infiltrate their ranks and bribe officials.