The agreement still must be approved by the Gang of Eight senators, four Democrats and four Republicans. If they do so as expected, Senate legislation on a broad new immigration law would be advanced in the Senate in the coming weeks.

In recent days, the immigration effort had been stalled by failure to forge an agreement on the guest-worker program, although the White House insisted that progress was being made.

President Barack Obama wants to fulfill a campaign pledge by gaining passage of a law that would create a pathway to citizenship for illegal immigrants currently in the country. He has vowed to do what he can on immigration through executive actions in the absence of legislation.

Immigration long has been a controversial issue in the United States and previous efforts to craft a comprehensive overhaul of American immigration laws have failed, with Democrats and Republicans remaining far apart.

Many Republicans previously had taken a hard position against illegal immigrants. Obama's unsuccessful Republican challenger last year, Mitt Romney, had advocated "self-deportation" of illegal immigrants. Republicans in Arizona and other states passed tough laws cracking down on illegal immigrants.

But the mood for a deal is ripe because Republicans saw Hispanic Americans vote overwhelmingly for Obama and other Democratic candidates in last November's elections and they need to woo this increasingly important voting bloc.

Many Republicans see gaining favor with the Hispanic voting bloc, which accounts for 10 percent of the U.S. electorate and is growing, as a matter of political survival.

Republicans want to ensure that security along the U.S.-Mexican border is improved before immigrants can get on a path to citizenship. Obama feels security is sufficient but this disagreement is not seen as a deal-breaker.

"We're seeing right now a good bipartisan spirit," Obama told Spanish-language network Univision on Wednesday. "I want to encourage that and hopefully we'll be able to get it done."

It seems a foregone conclusion that the Senate will pass immigration reform when it comes to the floor in the next couple of weeks. The House is a different story. House Republicans will push hard for some kind of certification that the border is better secured -- and likely won't get it. The question is are there enough Republicans in the House willing to make border security a deal breaker? Perhaps not, but any kind of path to citizenship might be more problematic.

But with almost a near-solid Democratic vote, there only needs to be about 20 Republicans to vote for the bill in order for it to pass. That seems pretty certain at this point, so it looks like Obama will get his signature legislation for his second term.