MEXICO CITY (Reuters) - Mexico's Congress approved a legal reform on Thursday that will allow foreign immigration and customs agents to bear arms while in the country, an issue that has been a source of tension with the United States.

Security personnel for high-level foreign officials will also be permitted to carry arms during visits to Mexico.

An unarmed U.S. Immigration and Customs Enforcement agent was killed in 2011, after his car was ambushed by drug gang members in central Mexico.

The reform still needs to be signed into law by President Enrique Pena Nieto.