By Steve Holland and Mark Felsenthal
SAN JOSE, Costa Rica (Reuters) - President Barack Obama signaled on Friday that a proposal to add a same-sex partnership measure to an immigration overhaul should not be allowed to derail the entire legislative effort.
Obama has used the prospect of new immigration laws as a major selling point for stronger U.S. relations with Latin America on a three-day tour of Mexico and Costa Rica that ends on Saturday.
But a proposal by Democratic Senator Patrick Leahy of Vermont has cast uncertainty into the delicate process of reaching a compromise on immigration.
Leahy plans to propose next week an amendment to the legislation that would let gay Americans sponsor their foreign-born partners for green cards, which confer permanent residency.
If it were to be included in the final bill, opposition from social conservatives could doom to failure the biggest effort in decades to improve the U.S. immigration system.
Obama said he would support Leahy's move, but that the broader effort to reform U.S. immigration must be kept in mind.
"I can tell you I think that this provision is the right thing to do. I can also tell you I'm not going to get everything I want in this bill. Republicans are not going to get everything that they want in this bill," he said.
Obama is under pressure to gain a legislative victory on immigration after a slow start to his second term, marked by a failure to achieve passage of new gun regulations and an ongoing budget standoff with lawmakers.
Washington's battles were not far from his mind as Obama visited Costa Rica, the first U.S. president to do so since Bill Clinton came in 1997. He met with a host of Central American leaders in San Jose on Friday evening.
Costa Rica declared a national holiday in honor of Obama and thousands of people, many of them school children in uniforms, lined the streets of San Jose for a glimpse of the president's motorcade.
At Casa Amarilla, headquarters of the Costa Rica foreign affairs ministry, school children wearing white shirts with blue silk shawls stood in a circle around Obama and sang to him.
At their joint news conference, Obama and Costa Rican President Laura Chinchilla emphasized the growing importance of economic ties as a way to buoy the region, after years in which most U.S. relationships with Central America centered around fighting drug cartels.
Security concerns remain paramount, they said, but must take their place alongside trade.
"What we want to do is push ahead with initiatives that help make trade easier," Chinchilla said.
"We have to make sure everybody feels opportunity," said Obama.
(With reporting by Isabella Cota; Editing by Simon Gardner and Xavier Briand)