A bipartisan group of senators neared agreement on a comprehensive immigration bill that would put illegal immigrants on a 13-year path to citizenship, officials with outside groups keeping up with the talks said Thursday.

The legislation also would install new criteria for border security, allow more high- and low-skilled workers to come to the U.S. and hold businesses to tougher standards on verifying their workers are in the country legally, according to outside groups and lawmakers involved. Together, the measures represent the most sweeping changes in immigration law in decades.

The senators in the so-called Gang of Eight were meeting for hours at a time daily this week trying to complete a deal. There were still big disagreements on some issues, but they hoped to resolve most of them before Congress began a two-week recess at week’s end. That would allow them to meet a self-imposed deadline to present their legislation next month.

“We are grappling with a number of issues, we really are, but I think we are making progress,” said Sen. John McCain, R-Ariz. “Some of these issues are very complicated.”

The group was under pressure to speed up its work. Protesters converged Thursday on the office of Sen. Chuck Schumer, D-N.Y., a leader of the group, to accuse him of breaking his initial promise to have the bill done in March. Senate Judiciary Chairman Patrick Leahy, D-Vt., whose panel would take up the legislation, complained this week that the group was taking too long. As a result, Leahy said, his committee won’t be able to complete writing the bill itself in April, as he had hoped.

Several officials with outside groups said the biggest remaining areas of disagreement dealt with legal rather than illegal immigration. Top among them was a proposed program to bring in tens of thousands of new immigrants to fill low-skilled jobs. It had been the subject of difficult negotiations between the U.S. Chamber of Commerce and AFL-CIO. Although the two sides had made progress, they had not yet reached agreement on all details about the structure of a new visa program. Senators were mediating offers and counteroffers.

There was more agreement on the path to legalization for the 11 million illegal immigrants already in the country. Outside officials said there was basically consensus on the issue, even though it was the one that tended to cause the most public consternation. But senators have emphasized repeatedly that nothing was agreed to until everything was agreed to.

The new bill would contemplate a 10-year wait for illegal immigrants already in the U.S. before they could get a green card allowing them permanent residency, senators have said. During that time they would be in a provisional legal status and would not have to return to their home countries as current law requires.

Once they got the green card, they would have to wait three years to be able to apply for citizenship, compared with the five-year wait that most green-card holders currently have to abide, outside officials say they’ve been told.

That added up to 13 years, which would put the Senate bill in line with immigration legislation drafted by President Barack Obama, which he has said he would offer only if the Gang of Eight process stalls.

There’s also said to be substantial consensus among the senators on border security issues. The bill would require that the border be secured before illegal immigrants could embark on the path to citizenship and would put in place new border security criteria including a commission of border state officials to advise on the issue.