President Felipe Calderon promised on Tuesday to get to the bottom of how two U.S. officials were shot at by federal police officers, allegedly in plain clothes, while heading to a Mexican marine base.

Speaking alongside the U.S. ambassador in Mexico, Calderon said the shooting incident should not hinder bilateral efforts to fight Mexico's violent drug cartels.

"We can't allow these things to happen, whether it is because of negligence, lack of training, lack of trust or complicity," Calderon said.

"Fighting organized crime and drug trafficking is a job that the Mexican government cannot do alone. It is a problem we must fight together."

The U.S. officials were driving a bullet proof Toyota van with diplomatic plates when they came under attack last Friday morning. A Mexican marine captain was also in the vehicle.

A Mexican official close to the investigation who asked not be identified said the three were within a few miles of the marine base when they were shot at by men in civilian clothes.

They tried to drive away but were attacked by assailants in several other vehicles who managed to shoot out the van's tires and back window, the official said.

Mexican marines, soldiers and federal police arrived at the scene and detained 12 officers over the incident.

A judge ruled on Monday that the detained officers be held in custody for 40 days pending the investigation.

In their initial statements, the police claimed they confused the U.S. officials for criminals, but the government is also investigating whether it was a deliberate attack.

"We are going to follow all the lines of investigation necessary, everything that comes up in the probe," said Mexico's federal attorney general Marisela Morales.

There have been many cases in which Mexican police officers have been prosecuted for working with drug cartels.

The U.S. employees were taken to a Mexico City hospital in stable condition following the attack but their whereabouts on Tuesday were unclear.

U.S. State Department spokeswoman Victoria Nuland said the United States was working with Mexico in the case. "I'm not going to get ahead of the investigation. I think we're going to wait and see what that concludes."

U.S. officials have declined to identify which agency or department the Americans worked for, simply calling them embassy employees.

Major U.S. agencies including the CIA, FBI and Drug Enforcement Administration operate out of the embassy in Mexico City.

Under the "Merida Initiative" which began in 2008, U.S. agents have trained Mexican police and soldiers to help them with Calderon's offensive against traffickers. Washington has also supplied Mexico with equipment including Black Hawk helicopters and surveillance gear.

Much of the training and hardware has gone to the marines, an elite force that operates out of Mexico's Navy Ministry and has captured or killed several major drug traffickers.

However, the United States has also trained the federal police, whose officers were allegedly involved in the attack.

During Calderon's six-year offensive against cartels, there have been more than 55,000 drug related murders. More than 3,000 police and soldiers have died, although many were involved with the gangs.

Incoming president Enrique Pena Nieto will take power in December and has promised to radically reduce the rate of murder, kidnapping and extortion by the cartels.