Heartened by huge marches across the United States and President Bush's support for a guest-worker program, Mexico remains optimistic the immigration bill in Congress can be transformed into something that will benefit millions of illegal migrants.

Mexicans welcomed the proposal approved Monday by the Senate Judiciary Committee to legalize undocumented migrants and provide temporary work visas, and President Vicente Fox told local media the bill was a "very important" step.

But U.S. ambassador Tony Garza warned Mexicans that the proposal still faces a difficult path.

"The debate will no doubt be heated and at times contentious," Garza wrote in an open letter distributed in Mexico City. "The debate in the Senate is only one part of the lengthy process."

Fox has been pushing for a migration accord that would grant legal status to many of the estimated 6 million undocumented Mexicans in the United States. He is likely to bring up the topic when he meets with Bush starting Thursday in the Caribbean resort city of Cancun.

"The recent demonstrations in different places in the United States show the imminent need for an immigration accord that meets the interests of both countries," presidential spokesman Ruben Aguilar said Monday.

Debate began Monday in the Senate on bills that would make it a felony to be in the United States illegally, impose new penalties on employers who hire illegal immigrants and erect additional fences along one-third of the U.S.-Mexican border.

Discussion on Capitol Hill began two days after thousands of people took to the streets of Los Angeles and cities across the United States to protest stricter limits on illegal migrants. Bush called efforts to balance the United States' need for low-wage workers with the tightening of its borders an "emotional debate."

Although a bill granting amnesty to illegal immigrants is unlikely to be approved by Congress, Fox has remained hopeful a guest-worker program will be put in place before he leaves office on Dec. 1.

Illegal migration has also emerged as a significant issue in Mexico's presidential race. The three top candidates in the July 2 elections have all pledged to strengthen the economy and make Mexican jobs attractive enough to keep people from heading north.

If the United States approves a guest-worker program, it would bolster Fox's image and aid the prospects of Felipe Calderon, presidential candidate for Fox's National Action Party, or PAN, said George Grayson, a Mexico expert at the College of William & Mary in Williamsburg, Va.

Fox, who ended the seven-decade dominance of the Institutional Revolutionary Party, or PRI, in 2000, began his term promising to fight for a comprehensive immigration reform that would legalize the status of millions of Mexican migrants in the United States.

But the Sept. 11, 2001, attacks turned the U.S. focus to enhanced border security, not immigration reform.

"Fox is looking for some way to be remembered in history, other than (being) the politician who ousted the PRI from power," Grayson said.

Immigration and border security — and the balance between the two — is expected to dominate the two days of meetings between Fox, Bush and Canadian Prime Minister Stephen Harper in Cancun.

Mexican Foreign Secretary Luis Ernesto Derbez said Monday it was necessary not to focus the immigration debate on solutions based only on security.

The international community "must share responsibility so that those forced to migrate be regulated by plans that include respecting their dignity," Derbez said.

The United States has asked Mexico to do more to strengthen security along their common border. In a document approved by the Mexican Congress in February, Mexico pledges to fight people-smuggling networks and to work closely with the United States to tighten border enforcement.

Among the report's suggestions are creating more jobs at home for would-be migrants and providing housing credits.

A portion of the report was published as a paid advertisement last week in major Mexican newspapers and in The New York Times, The Washington Post and the Los Angeles Times.

With Bush's approval ratings falling and Fox about to leave office, analysts say their summit this week will have little influence on the immigration debate.

"Bush is so weak that he won't be able to deliver on any of his promises," Grayson said. "You've got one lame duck meeting with a probably lamer duck. What you'll see is two lame ducks fluttering around."