A final vote on the legislation, which leads President Barack Obama's second-term domestic policy agenda, is expected by the end of next week.
The emerging deal calls for a doubling of the Border Patrol, with 20,000 new agents, 18 new unmanned surveillance drones, 350 miles (563 kilometres) of new fencing and an array of fixed and mobile devices to maintain vigilance.
"We have militarized our border, almost," said Sen. Lindsey Graham.
The next move would be up to the House of Representatives, where opposition Republicans in the majority in the chamber are overwhelmingly opposed to granting citizenship to immigrants living in the United States illegally. Talks on any final compromise would be held later this year — if then.
The White House declined to respond to requests for comment on the Senate proposal, even though congressional officials said administration officials were involved in the formal drafting of the terms.
Under the deal, an estimated 11 million immigrants living in the United States illegally would be eligible to obtain legal status while border security is increased. They could not be awarded green cards, which bestow permanent residency status, until the entire border enhancement plan is put into place.
Before the deal was reached, American Civil Liberties Union called the proposal a "massive deployment of force" that would be "simply devastating for border communities."
Apart from the border security measures, the legislation as drafted already included implementation of a biometric system to track the comings and goings of foreigners at air and sea ports as well as land crossings, and a requirement for businesses to verify the legal status of job seekers.
In addition to border security issues, the legislation would increase the number of visas going to high-skilled workers whose labour is sought by U.S. technology firms, create a new program for lower-skilled immigrants and allow farm labourers to come to the country temporarily to perform seasonal jobs.
Separately, younger immigrants who came to the United States illegally as children would be eligible for legal status more quickly than others.
For foreigners looking to move to the United States legally, a decades-old system that emphasizes family ties would be replaced by one that gives more weight to education, work skills, English proficiency and relative youth.
Associated Press writers David Espo and Erica Werner contributed.