Leaders have reached a deal on the first major overhaul of the nation's immigration system in years.

And despite concerns from immigrant advocates, it puts border security before amnesty.

A landmark immigration reform bill touted as sweeping legislation that would put some 11 million immigrants living in the U.S. illegally on a path to citizenship includes the toughest border security provisions in U.S. history, a person familiar with the proposals told the Associated Press Wednesday.

A bipartisan group of senators, known as the "Gang of Eight," have agreed to specific border security provisions in the legislation which will be released within days.

The legislation would call for surveillance of 100 percent of the U.S. border with Mexico and apprehension of 90 percent of people trying to cross in certain high-risk areas. People living here illegally could begin to get green cards in 10 years but only if a new southern border security plan is in place, employers have adopted mandatory electronic verification of their workers' legal status and a new electronic exit system is operating at airports and seaports.

"A lot of people here would not want to put dollars into the border, but as a price to get citizenship, as long as it's not an impediment to citizenship but rather works alongside citizenship, it's something we can all live with."

- Sen. Chuck Schumer, D-N.Y.,said, after talking to the Hispanic House members.

The person provided the information on condition of anonymity because the deliberations were private.

The contours of the tough new border security plans emerged as senators moved closer to unveiling sweeping legislation that would put some 11 million immigrants living here illegally on a path to citizenship and allow tens of thousands of high- and low-skilled workers into the country on new visa programs, in addition to securing the border.

Lawmakers and aides said all the major elements were about complete. A final deal was near on a new visa for agriculture workers. There were small details to be dealt with on visas for high-tech workers, but Sen. Dick Durbin, D-Ill., said it wasn't enough to hold up the bill.

"We are closer now than we have been in 25 years for serious immigration reform," Durbin told reporters Wednesday after he and other Democrats in the Senate negotiating group briefed members of the Congressional Hispanic Caucus. "This president is behind it, and there is a strong, growing bipartisan effort in the Senate to support it. We hope that the House will do the same."

Meanwhile tens of thousands of pro-immigration activists massed outside the Capitol and in cities around the country to push Congress to act. They waved American flags and carried signs reading, "Reform immigration for America now!"

The border security piece of the legislation is critical to getting support from Republicans, but some Democrats have opposed making a path to citizenship contingent on border security. Sen. Chuck Schumer, D-N.Y., said that the new requirements wouldn't impede citizenship.

"A lot of people here would not want to put dollars into the border, but as a price to get citizenship, as long as it's not an impediment to citizenship but rather works alongside citizenship, it's something we can all live with," Schumer said, after talking to the Hispanic House members. "What we've said all along is triggers have to be objective and attainable in a way it doesn't interfere or delay with people becoming citizens, and that's in the bill."

According to the person familiar with the proposals, the new border security requirements call for 100 percent surveillance of the entire border, and apprehending 90 percent of border crossers or would-be crossers — or getting them to turn back to Mexico — in sectors where the majority of unauthorized entries take place.

As of the end of the 2010 fiscal year, the Department of Homeland Security reported achieving some level of operational control of 44 percent of the nearly 2,000-mile border, according to a Government Accountability Office report this year. Operational control was defined as the ability to detect and respond to cross-border illegal activity.

In one border sector cited by GAO, the busy Tucson sector, 64 percent of people who managed to make it across the border were apprehended in 2011, while 23 percent turned back to Mexico and 13 percent got away. That meant the sector stopped or turned back 87 percent of crossers, close to the 90 percent level sought by the legislation.

The new goals would be achieved by giving the Department of Homeland Security six months from the bill's enactment to create a new border security plan deploying the personnel, infrastructure and technology needed to achieve the 90 percent effectiveness rate. Also within six months, the department would have to create a plan to identify where new fencing is needed on the border. Once those plans are certified, people living here illegally could begin to apply for a provisional status allowing them to work here legally.

If the 90 percent rate of apprehensions isn't achieved in high-risk border sectors within five years, a commission made of border state officials would make recommendations on how to achieve it.

After 10 years, people granted "registered provisional immigrant status" could apply for green cards granting them permanent residency — and the ability to seek citizenship — if the new security and fencing plans have been completed, the mandatory employment verification system is in place and used by all employers, and the new electronic exit system is operating at airports and seaports, collecting machine-readable visa or passport information from airplanes and ships.

The electronic exit system is meant to keep better track of people in the country on temporary visas. Some 40 percent of people in the country illegally arrived with visas but stayed after they expired. The employment verification piece would be an expansion of an existing system called E-Verify that's currently voluntary for most employers, though it's mandatory in some states.

The bill would allocate $5.5 billion for the various proposals, including $1.5 billion for fencing, $2 billion for other border measures and $2 billion to help the commission of border state officials do its work, should that become necessary, the person said, stressing more or less money could be allocated if needed.

Based on reporting by the Associated Press.

Follow us on twitter.com/foxnewslatino

Like us at facebook.com/foxnewslatino