Mexico took the unusual step of opening an investigation into the killing of a man officials said was shot while sneaking into California, using the death to again draw attention to a contentious U.S. anti-immigration measure.

The death of the 18-year-old came as Mexico's government continued its vocal campaign against the bill approved by the U.S. House of Representatives last month.

"This occurrence does no more than provide evidence that only a law that guarantees legal entry and is respectful of human rights can resolve the migratory problem both countries face," Ruben Aguilar, the chief spokesman for President Vicente Fox, said Monday.

Many Mexicans oppose the U.S. measure, which would build more border fences, make illegal entry a felony and enlist military and local police to help stop undocumented migrants.

Aguilar said the death of Guillermo Martinez showed that extending border walls will not curb illegal immigration.

Martinez died Saturday in a Tijuana hospital, the Baja California state attorney general's office said. He died one day after he was shot by a U.S. Border Patrol agent near a metal wall separating that city from San Diego, according to witnesses cited by Mexican officials.

Raul Martinez, a spokesman for the Border Patrol said the agent had been "assaulted by an individual who threw a large size rock."

"The agent, fearing for his life at that time, fired one round at the individual, who fled back to Mexico," Martinez said Monday.

The spokesman, who is not related to the dead 18-year-old, said U.S. investigators were unsure if the victim had been struck by the bullet because he crossed back into Mexican territory.

Mexico's federal Attorney General's Office said the probe was opened against "whomever is found to have been responsible," but did not name a suspect. Mexico generally does not try to apply its laws to events that occurred in other nations.

The attorney general's statement said Martinez was with four other people when he was shot.

Martinez was from the western city of Guadalajara but was living in Tijuana with his older brother, who apparently witnessed the shooting, said Luis Cabrera, Mexico's consul general in San Diego. Cabrera said Mexican officials were collecting reports from him and other witnesses.

Mexican officials have grown increasingly vocal in their opposition to the House bill passed Dec. 16, which Foreign Relations Secretary Luis Ernesto Derbez branded as "stupid and underhanded." Fox has called it shameful.

Officials of Mexico's federal Human Rights Commission have acknowledged that Mexico already employs some of the same methods in its own territory. But Aguilar again attacked the U.S. measure Monday, saying "walls and police crackdowns never will resolve migration problems."

In 2004, Mexican migrants in the United States sent home more than $16 billion in remittances, according to Mexico's central bank, giving the nation its second biggest source of foreign currency after oil exports.

The U.S. Senate is expected to address the immigration measure in February.