Even as many Republicans say they support an overhaul of immigration laws, it is still expected to be a long process, with Sen. Marco Rubio, R-Fla., a leader of the effort, saying last week that the current Senate agreement would not make it through the Republican-controlled House.
But during the trip, Obama expressed confidence that a final bill would not only gain his support by including a pathway to citizenship for the 11 million illegal immigrants in the United States but also ultimately pass Congress.
"I would expect that not only will I be supportive, but also I think we can get it through the House," Obama told Univision in Mexico on Friday before leaving for Costa Rica. "It's the smart thing to do."
In comments later Friday at a news conference in Costa Rica, the president reaffirmed that he believes the gay and lesbian partners of American citizens should be treated in the same way as straight people under immigration laws.
Sen. Patrick Leahy, D-Vt., the Judiciary Committee chairman, has suggested he would introduce an amendment to the bill to accomplish this goal, but Republicans have said it would be a poison pill, and there is little expectation it will be in the final version.
"I've said in the past that the LGBT community should be treated like everybody else," Obama said. "That's, to me, the essential, core principle behind our founding documents."
He did not say the LGBT component was critical.
"I think that this comprehensive immigration bill has the opportunity to do something historic that we have not done in decades," Obama said. "But I don't expect that, after we're finished with it, that people are going to say, there's not a single problem that we have with our immigration system, any more than is true after any piece of legislation that we pass."
Before leaving Costa Rica on Saturday morning, Obama said that tough border security would remain a key element of his approach to immigration and policy in the region.
"You can't separate out the dangers and challenges and concerns of the border from the enormous opportunities that a well-managed, well-regulated border presents," Obama told a business conference in San Jose.
Obama spent most of his time in Mexico and Costa Rica speaking to local leaders and citizens, but the trip had a backdrop of domestic U.S. politics - a point Obama acknowledged in Mexico City.
"Without the strong support of Latinos, including so many Mexican Americans, I would not be standing today as president of the United States," Obama said in a speech in Mexican City on Friday. "That's the truth."
Obama began his trip Thursday in Mexico City, where he met with the new Mexican president, Enrique Pena Nieto.
There, he pushed for deeper economic ties at a time when the Mexican economy is increasingly a source of growth in the United States and a buyer of American-made goods and services.
"Right now, over 40 percent of our exports go to the Americas. And those exports are growing faster than our trade with the rest of the world," Obama said in his weekly address. "That's why I visited Latin America this week - to work with leaders to deepen our economic ties and expand trade between our nations."
But the focus was also on security, where Obama acknowledged that the relationship between U.S. and Mexican law-enforcement and intelligence agencies is changing under Pena Nieto, who has sought to scale back the United States' role in confronting drug trafficking and organized crime in Mexico.
The new posture is raising concerns among some U.S. officials who worry it will hurt years of efforts to stem the flow of drugs over the border. But Obama accepted the new approach, saying the Mexican people have the right to conduct internal security as they desire.