President Obama understands GOP concerns about the need to link improved border security to changes to immigration laws, two key Republicans involved in the effort said Tuesday after meeting with Obama at the White House.

FILE - In this March 28, 2012 file photo, Sen. John McCain, R-Ariz. listens during a news conference on Capitol Hill in Washington. McCain said in an interview posted online Friday that "foreign money" was helping fellow Republican Mitt Romney's presidential hopes and singled out one of his ally's most generous supporters. (AP Photo/Jacquelyn Martin, File) Sen. John McCain (R-Ariz.) (AP Photo/Jacquelyn Martin, File)

Sens. John McCain (Ariz.) and Lindsey Graham (S.C.) said the meeting, requested by Obama, covered a variety of topics and included a robust discussion of how to overhaul those laws.

The two are members a group of eight senators--four Democrats and four Republicans--who are working to write an immigration bill for introduction in March.

According to a joint statement of principles issued by the Senate group last month, illegal immigrants should be able to quickly seek temporary legal status, but they should not be able to seek permanent residency until the border is more secure. Immigrant advocates have said that linkage worries them, but Republicans have said it is key to a bipartisan agreement.

McCain and Graham both left the White House meeting, which they described as especially productive, saying they believe Obama understands their worries about the border.

"He understands the parameters of what we’re doing," on the issue, McCain said, adding that he left the meeting "more confident" Obama understands border security.

"He understands that we need border security that we can afford," Graham said. "Sen. McCain made a strong point about the border. The president understands the working components of it."

Graham and McCain both praised Obama for his efforts on the issue and said they believe the president is sincere in his desire for legislation that can pass Congress this year.

"It was one of the best meetings I’ve ever had with the president," Graham said.

"I think we’ll have a presidential leadership in a very productive way on immigration reform. And with that, we have a very good chance of doing it this year," Graham said.

In a joint statement, the two senators said Obama had offered his "firm commitment" that he would "do whatever is necessary" to pass legislation this year.

The meeting represented an unusual outreach from Obama. It grew out phone calls Obama placed last week to McCain and Graham, along with Sen. Marco Rubio (R-Fla.) He had been unable to reach the fourth Republican involved in talks, Sen. Jeff Flake (R-Ariz.), because he was traveling out of the country.

The White House meeting could be intended to send a strong signal about Obama's continued support for the quiet Senate negotiations.

Some Republicans had said they doubted the president's commitment to the bipartisan process after the draft of a separate White House bill leaked to the press. Obama has said he supports the Senate effort but would be prepared to move ahead with his own legislation if the talks falter.

The meeting could also be an attempt to quiet criticism from Capitol Hill, where lawmakers in both parties have long griped that they rarely hear from the president.

McCain and Graham have also been warning publicly about the impact to national defense of allowing $85 billion in spending cuts to take effect Friday. Neither would say whether they also discussed the so-called sequester.

Homeland Security Secretary Janet Napolitano has been touring borders posts in recent weeks in California, Texas and Florida to review border security. The administration has touted the record level of resources directed since Obama took office to border control and immigration enforcement.

Still, Napolitano warned this week that looming across-the-board spending cuts could deeply damage border operations. And on Tuesday, the administration announced it had released hundreds of illegal immigrants held in detention facilities because the cuts eliminated funding needed to hold them, a move that drew sharp complaints from Republicans.