(CNN) -- Gunmen opened fire on two U.S. immigration agents in Mexico on Tuesday, killing one and injuring the other, officials said.

The two agents with U.S. Immigration and Customs Enforcement (ICE) were attacked Tuesday afternoon while driving between Mexico City and Monterrey.

One of the agents was gravely wounded and died later Tuesday. The other was in stable condition after being shot in the arm and leg, according to a statement released by the U.S. Department of Homeland Security.

The shooting took place about 23 miles north of downtown Mexico City at approximately 3 p.m. ET, an ICE official said. The official spoke to CNN on the condition of anonymity because the case is still under investigation.

The agents, according to the official, were doing "routine work," traveling on a well-traveled highway in an armored car with diplomatic plates. They were forced off the road in Ojo de Aqua and surrounded by a group of more than 10 people.

Prior to the shootings the agents apparently identified themselves as diplomats, the official said.

The shooting provoked a swift condemnation from the U.S. government.

DHS Secretary Janet Napolitano said, "Let me be clear: Any act of violence against our ICE personnel -- or any DHS personnel -- is an attack against all those who serve our nation and put their lives at risk for our safety.

"The full resources of our department are at the disposal of our Mexican partners in this investigation," Napolitano said.

"I am deeply saddened by the news," Napolitano said.

Senator Joseph Lieberman, I-Connecticut, who chairs the chamber's Homeland Security and Governmental Affairs Committee, called the shootings "the latest reminder of the grievous violence south of our border that must be stopped."

One official said the victims, whose identities have not been released, were the first ICE agents to be gunned down in Mexico. According to ICE, the agency has about 30 officers assigned to its office in Mexico City. They work a range of issues including drugs, weapons, currency and immigration.

"ICE is working with the U.S. State Department, Mexican authorities and other U.S. law enforcement partners to investigate the shooting," the agency said in a statement. "Our thoughts and prayers are with our colleagues."

ICE Director John Morton said the "tragedy is a stark reminder of the risks cofronted and the sacrifices made by our men and women every day.

Mexican officials also released a statement on the shootings.

"Mexico's government vigorously condemns this serious act of violence, and expresses its solidarity with the United States Government and the families of those attacked," the statement read. "Federal authorities, in coordination with state cooperation, have an ongoing investigation to clarify what happened and bring to justice those responsible."