WASHINGTON — The presidents of Mexico and the United States offered a united front during a state visit Wednesday — not just against brutal drug cartels but against Arizona and its tough new law that puts police on the front lines of immigration enforcement.

The joint rebuke left border-control advocates steaming, reflecting intense feelings that for years have stymied efforts to overhaul U.S. immigration laws.

“In the United States of America, no law-abiding person, be they an American citizen, a legal immigrant, or a visitor or tourist from Mexico, should (ever) be subject to suspicion simply because of what they look like,” Obama said at a news conference, with Mexican President Felipe Calderon at his side.

Calderon said that the Arizona law opens his countrymen, whether in the U.S. legally or not, to harassment and discrimination. Supporters dispute that.

The law makes it a crime to be in the United States without permission, and requires police to investigate the immigration status of anyone they suspect of being in the country illegally. Calderon asserted that it was created “so that people who work and provide things to this nation will be treated as criminals.”

Mexico is hoping the White House will go to federal court to prevent enforcement, and Obama said he is awaiting a Justice Department review before deciding whether to try.

The Arizona controversy is intertwined with border security policy and a lingering debate over immigration reform. This year’s volatile electorate has made it hard to see a breakthrough in that area, which has eluded Congress for years.

Obama vowed to work with the Mexican government to create jobs and fight drug cartels, and to “ensure that our common border is secure, modern and efficient, including immigration that is orderly and safe.”