(CNN) -- President Barack Obama supports a proposal to allow Americans to seek legal immigration status for same-sex partners, a plan that could undermine bipartisan support for comprehensive immigration reform.
Obama indicated at a news conference in Costa Rica on Friday that the idea was "the right thing to do," but acknowledged that such a politically charged issue may ultimately not make it into a final immigration package.
"I'm not going to get everything I want in this bill," he said in response to a question about his support for gay rights and its relation to immigration reform, a major priority for Democrats seeking to maintain strong support from Hispanics and Republicans trying to woo them to their side.
A bipartisan group of senators, known as the "Gang of Eight," will formally introduce its proposal to overhaul U.S. immigration policy on Tuesday before the Senate Judiciary Committee.
The measure is the leading effort on the subject in Congress at the moment, and Obama has encouraged Congress to pass comprehensive reform this year.
The proposal calls for a 13-year path to citizenship for those who entered the United States illegally before 2012.
It would take 10 years for such undocumented immigrants to get green cards and then another three years to gain citizenship. Along the way, they would have to pay a fine and back taxes and pass a background check.
Judiciary Committee Chairman Sen. Patrick Leahy of Vermont is proposing an amendment that would allow gay Americans to sponsor their partners not born in the United States for green cards.
Currently, such rights apply only to foreign-born men or women in heterosexual marriages with U.S. citizens.
If Leahy moves head, there are fears it could upend efforts for any significant Republican support for the compromise immigration effort.
Florida Sen. Marco Rubio, one of the Republican architects of the bipartisan immigration package has said adding such a provision would not be politically feasible in the ideologically polarized Congress.
Obama acknowledged that political reality.
"If there are things that end up being left out in this bill, or things that I want to take out of a bill, but if it's meeting those core criteria around a comprehensive immigration bill that I'm looking for, then we go back at it and we fix what's not there and we continually improve what's been presented," he said.
In his weekly address, Obama underscored his criteria for immigration reform. This includes more effective border security; "hold employers accountable if they knowingly hire undocumented workers;" making the legal immigration system work more effectively; and making sure there is a pathway to citizenship for immigrants already in the country.
"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."
Obama said in Mexico earlier on Friday that he intends to work closely with the Mexican government on immigration and was confident a reform effort would pass.
"I'm optimistic that - after years of trying - we are finally going to get it done this year," Obama said in Mexico City.
CNN's Ashley Killough, Dan Merica, Alan Silverleib and Catherine E. Shoichet contributed to this report.
™ & © 2013 Cable News Network, Inc., a Time Warner Company. All rights reserved.