Far-reaching U.S. immigration legislation neared a final committee vote Tuesday as the White House and Democratic supporters sought to delay a showdown over the rights of gay spouses until a debate in the full Senate.

“There have been 300 amendments. Why shouldn’t we have one more?” replied Sen. Patrick Leahy, the Democrat who chairs the Senate Judiciary Committee. He was responding to concerns that a vote on the issue inside the panel could unravel months of work on the bill, which gives a chance at citizenship to millions of immigrants living in the United States illegally.

The measure also creates a new program for low-skilled foreign labor and would permit highly skilled workers into the country at far higher levels than is currently the case. At the same time, it requires the government to take new steps to guard against future illegal immigration.

Overhaul of the U.S immigration system is a second term priority for President Barack Obama.

As the day wore on, opponents of the bill made a final bid to strip the measure of its signature feature — a path to citizenship for millions of immigrants illegally in the U.S. that could take 13 years and payment of fines totaling $2,000. Sen. Ted Cruz’ proposal failed on a vote of 13-5.

The rejection was one of numerous ways in which the bipartisan coalition behind the White House-backed measure demonstrated its command of the proceedings.

Without so much as a roll call vote, the panel adopted a compromise setting the terms of the expansion of H-1B high-tech visas, a deal that brought Sen. Orrin Hatch, a Republican, over to the ranks of supporters.

Under the deal, the number of highly skilled workers admitted to the country would rise from 65,000 annually to 110,000, with the possibility of a further rise to 180,000 depending in part on unemployment levels.

Firms where foreign labor accounts for at least 15 percent of the skilled work force would be subjected to tighter conditions than companies less dependent on H-IB visa holders.

The compromise was negotiated by Hatch, whose state of Utah is home to a growing high-tech industry, and Chuck Schumer, D-New York. It is designed to balance the interests of industry, which relies increasingly on skilled foreign labor, and organized labor, which represents American workers.

Rich Trumka, president of the AFL-CIO labor federation, attacked the deal sharply, saying Hatch’s amendments “are unambiguous attacks on American workers,” and change the bill so high-tech companies can bring in foreign workers “without first making the jobs available to American workers.

At the same time, he reaffirmed organized labor’s continuing support for the overall measure, a statement that allowed Schumer to add to the bill’s majority in committee without driving organized labor into the camp of its opponents.

At the White House, Obama and Vice President Joe Biden met privately in the Oval Office with a small group of the bill’s supporters, part of the administration’s campaign to build support.

The controversy over the rights of gay spouses, with the ability to fracture a bipartisan coalition behind the legislation, has hovered in the background of the debate from the beginning.

As drafted by the Gang of Eight, four Republicans and four Democrats who negotiated the basic provisions of the legislation, gay spouses do not have the same right to a green card as heterosexual spouses.

Leahy has introduced a proposal to reverse that, a provision that gay rights organizations seek and that ordinarily the White House and all the committee’s Democrats would back. In this case, though, its approval would almost certainly lead Republicans to abandon the bill, and it would face a quick demise on the Senate floor.