Updated 11:32 PM ET
MEXICO CITY U.S. Sen. John McCain said Friday that he and other lawmakers working on an immigration overhaul will meet with President Barack Obama on Tuesday to discuss the effort to revamp the system.
McCain, a member of a bipartisan group of eight senators working on a bill, said there is still significant disagreement with the president, but he is optimistic about producing legislation that includes a path to legalization for illegal immigrants.
The White House could not immediately confirm the Tuesday meeting.
"The president of the United States has supported our efforts. In fact we will be meeting with the president on Tuesday," McCain said during a visit to Mexico.
He did not say how many senators would attend the meeting.
McCain told reporters after meeting with Mexican President Enrique Pena Nieto that many details must be worked out between Obama and senators trying to produce legislation.
Asked about the prospects for reaching a deal, he said: "I am guardedly optimistic that we could by the end of the next month. There's still a number of agreements that need to be made before I can assure you that we will have a resolution."
While they differ on some key details, both Obama and the Senate are contemplating legislation that would provide a pathway to citizenship for most of the 11 million illegal immigrants already in the U.S., tighten border security, crack down on businesses that employ illegal workers and strengthen the legal immigration system.
McCain ticked off those aspects and added that he also envisions the legislation including a process for foreign agricultural and low-skilled laborers to work in the United States, a provision for highly educated workers to remain in the U.S., better identification cards for migrants and a special path for migrants brought to the U.S. as children.
"On some of those we have specific agreement, in other areas we agree in principle, but we have not resolved the details," he said. "We are making progress, but we are still not at a point where we can say we will succeed."
The meeting marks Obama's most direct involvement to date in negotiations by the bipartisan group of senators working to craft comprehensive immigration reform legislation. Wary of making it harder for Republicans to support an eventual bill by embracing it too closely, Obama has instead kept his distance.
The White House is prepping its own bill, but says it's just a backup in case congressional talks fail.
"It is, by far, the president's preference that the Senate process move forward, that the bipartisan group of eight have success, and that they produce a bill that wins the support of Democrats and Republicans in Senate," White House spokesman Jay Carney said this week.
The risks for Obama in getting too close to the process were on full display earlier in the week when details of Obama's draft bill were leaked, prompting concerns among some in Congress that the competing bill would make it harder for senators to strike a bipartisan deal. Florida Sen. Marco Rubio, a key Republican member of the group, said Obama's plan had "injected additional partisanship into an already difficult process."
But Senate aides said privately that bipartisan negotiations were in a good place and they did not feel as though the disclosure of details in Obama's draft bill had disrupted their process.
Last month, McCain spoke about the immigration issue with "." In reference to the plan -- which would grant temporary legal status to most of the 11 million illegal immigrants if they pass a criminal background check, pay a fine in back taxes, and learn English -- he said : "I hope that as more Americans see this proposal, that they will understand that we cannot have, forever, 11 million people living in the shadows in this country."
On another political issue, McCain said that former Sen. Chuck Hagel had been weakened by his battle to be confirmed as defense secretary, but McCain said he and Senate colleagues could work with Hagel at the Pentagon. Hagel is expected to be confirmed Tuesday after fierce attacks from fellow Republicans including McCain.
"I think he will have been weakened, but having said that, the job that he has is too important," McCain said. "I know that I and my other colleagues, if he's confirmed, and he very likely will be, will do everything we can to work with him."
McCain was defeated by Obama in the 2008 presidential election.
Turning to Mexico, McCain said Pena Nieto had reassured him that Mexico would continue to battle drug cartels while reassessing the country law-enforcement strategy.
The Mexican administration that took office Dec. 1 has, at least in its public rhetoric, emphasized social programs and economic growth as the answer to drug crime, a change from the previous government's focus on a militarized offensive against cartels. That has provoked concern in Washington about a reduction in anti-drug cooperation with Mexico.
"I have no doubt about his commitment," McCain said of Pena Nieto. "I think he feels that policies and practices of the previous administration need to be examined."
McCain said the Mexican president had emphasized the need to reinforce Mexico's southern border with Guatemala, a new emphasis in a relationship that has focused heavily on the U.S.-Mexican border.
The Mexican government said Pena Nieto "emphasized the necessity and the benefits of diversifying the agenda and the dialogue between Mexico and the United States," to focus on economic issues including the automotive industry and educational, scientific and technological cooperation.
Pena Nieto's government is in the midst of an international and domestic public relations campaign to undercut Mexico's association with drug crime and promote its relatively strong economic growth, driven partly by foreign investment in manufacturing plants here.