The officials spoke on the condition of anonymity because the talks were private.
If agreed to, the changes could clear the way for a strong bipartisan vote within a few days to pass the measure that sits atop President Barack Obama's second-term domestic agenda.
The developments came as Democrats who met with House Speaker John Boehner on Wednesday quoted him as saying he expected the House to pass its own version of an immigration bill this summer and Congress to have a final compromise by year's end.
Boehner, R-Ohio, already has said the legislation that goes to the House in the next month or two will not include a pathway to citizenship for immigrants in the United States illegally.
Precise details of the pending agreement in the Senate were unavailable, but Sen. John Hoeven, R-N.D., said it involved a major increase of resources to the border, including more manpower, fencing and technology. The underlying legislation already envisions more border agents; additional fencing along the U.S-Mexico border; surveillance drones; a requirement for employers to verify the legal status of potential workers; and a biometric system to track foreigners who enter and leave the United States at air and seaports and by land.
It was unclear what other portions of the legislation might be changed. There is pressure from some Republicans to make sure no federal benefits go to immigrants who are in the country illegally, at least until they become citizens.
"Our whole effort has been to build a bipartisan group that will support the bill," said Hoeven, who has not yet stated a position on the legislation. "That's what this is all about, and it's focused on border security."
Sen. Chuck Schumer, D-N.Y., one of the bill's most prominent supporters, said discussions with Republicans "have been really productive. We've made a lot of progress in the last 24 hours. Now we have some vetting to do with our respective allies."
The potential compromise came into focus one day after the Congressional Budget Office jolted lawmakers with an estimate saying that as drafted, the legislation would fail to prevent a steady increase in the future in the number of residents living in the United States illegally.
(Read More: CBO: Senate Immigration Plan Would Boost Economy)
The estimate appeared to give added credibility to Republicans who have been pressing Democrats to toughen the border security provisions already written into the bill. Schumer and Sen. Bob Menendez, D-N.J., met at midday with Graham, Hoeven and Sen. Bob Corker, R-Tenn. The Democrats and Graham are part of Gang of Eight.
If ratified, the compromise would mark concessions on both sides.
Some Republicans have been unwilling to support a bill that grants legal status to immigrants in the country illegally until the government certifies that the border security steps have achieved 90 percent effectiveness in stopping would-be border crossers.
On the other hand, Democrats have opposed Republican proposals to make legalization contingent on success in closing the border to illegal crossings. Under the legislation as drafted, legalization could begin as soon as a security plan was drafted, but a 10-year wait is required for a green card.
One plan to change that was sidetracked on a vote of 61-37.
Sen. Rand Paul, R-Ky., said his proposal would require Congress to vote annually for five years on whether the border is secure. If lawmakers decide it is not, "then the processing of undocumented workers stops until" it is, he said. The decision would be made based on numerous factors, including progress toward completion of a double-layered fence along the U.S.-Mexico border and toward a goal of 95 percent capture of illegal entrants. A system to track the border comings and goings of foreigners is also required.
While the public debate was taking place, lawmakers involved in the private talks expressed optimism.
Across the Capitol, House Republican leaders sought to present a friendlier face to Hispanics—a group that gave Obama more than 70 percent support in last year's presidential election.
Boehner met with the Democratic-dominated Congressional Hispanic Caucus, while rank-and-file members of his party reviewed areas of agreement with Latino religious leaders.
"It's a conversation Republicans want to have," Rep. Cathy McMorris Rodgers, R-Wash., said later at a news conference outside the Capitol.
Separately, the House Judiciary Committee approved legislation creating a program allowing farm workers to come to the United States to take temporary jobs in the United States.
The measure is one of several that the panel is considering in the final weeks of June as part of a piece-by-piece approach to immigration rather than the all-in-one bill that Senate is considering.
—By The Associated Press.