The House on Wednesday passed a contentious agricultural bill that would likely put more than a million illegal immigrants on a pathway to legal status as part of what supporters say is a vital modernization of the industry’s workforce -- but that immigration hawks blasted as a “large-scale amnesty.”

The Farm Workforce Modernization Act passed 260-165, with support from both Democrats and Republicans. The bill provides a process for undocumented farmworkers to seek a temporary five-and-a-half-year “Certified Agricultural Worker” status if they have worked for approximately six months in the industry in the last two years.

FARM BILL PANNED AS MASS 'AMNESTY' FOR ILLEGAL IMMIGRANTS HEADS TO VOTE IN HOUSE

That status can either be renewed indefinitely, or workers (along with their spouses and children) can begin a path to permanent legal status in the form of a green card. That path, according to the legislation, includes background checks and $1,000 fine.

To secure the green card, those who have worked in agriculture for 10 years or more must work for four more years, while those who've spent less than a decade in the sector would have to work eight more years. Once workers receive a green card, they are then free to pursue work in fields outside of agriculture.

The bill also streamlines the H-2A agriculture visa program, cutting processing time and costs for visa petitions. And it calls for the Department of Homeland Security to set up a pilot program that would give H-2A workers the ability to change jobs within the sector if they find work within two months.

Rep. Zoe Lofgren, D-Calif., the bill’s sponsor, said that it was a “historic” compromise and example of bipartisanship.

“This bill is a compromise, it’s not exactly what I would have written but it does stabilize the workforce,” she said on the House floor. “We have farmworkers who have been here for a very long time without their papers, living in fear and in some cases being arrested and deported.”

“We need to allow them to get an agricultural visa that is temporary and renewable so they can do the work we need them to do and their employers need them to do,” she said. “We need to stabilize the H-2A program, which this bill does. It simplifies it and also stabilizes wages.”

The bill had support from a number of farm groups, but has faced fierce opposition from immigration restrictionists, who claim that the amnesty component is similar to one in the 1980s that was rife with fraud and saw more than a million illegal immigrants win protection. They also say that the bill keeps immigrant workers tied to their jobs in a form of indentured servitude until they get their green cards.

“The only thing worse than another large-scale amnesty is one that then forces people to continue to toil for poor wages and under poor working conditions for the same unscrupulous employers who hired them illegally in the first place,” Dan Stein, president of the Federation for American Immigration Reform (FAIR), said in a statement.

“While Congress continues to do nothing to secure our borders, passing a bill that rewards both illegal aliens and their employers, and calling it ‘modernization,’ is a slap in the face to the plurality of Americans who consider immigration to be the nation’s most pressing domestic issue,” Stein said.

BORDER APPREHENSIONS DROPPED IN NOVEMBER FOR 6TH CONSECUTIVE MONTH, PER DHS DATA

The Heritage Foundation described the bill as a “clear cut example of amnesty,” warning that it "threatens the legal immigration system’s legitimacy and incentivizes aliens and farmers to ignore the legal immigration system in the future if it best serves their needs."

The bill's Republican support, with a number co-sponsoring the measure, raises the possibility that a form of such a bill could have a shot in the Republican-controlled Senate.

But while the bill has bipartisan support, it has also faced criticism from other Republicans lawmakers. Rep. Doug Collins, R-Ga., cited estimates from liberal groups that there are as many as 2.7 million farmworkers in the country, with more than half estimated to be in the country illegally, meaning that more than a million and a half could get a pathway to legal status.

“While the 224 pages of H.R. 5038 make many more changes to the H-2A program — some good and some bad — one need look no further than the first few pages to figure out the real point of this bill: a path to citizenship for an unknown number of illegal immigrants who do some work in agriculture, along with their families,” he said at the Judiciary Committee markup last month.

He also said the bill’s document standards are low and could allow illegal immigrants with multiple DUI convictions and a history of Social Security fraud to get legal status.

CLICK HERE TO GET THE FOX NEWS APP

As with most bills that include a path to legalization for those in the country illegally, there are some enforcement parts of the bill as well, but they come with major caveats.

While the bill would establish mandatory E-Verify (a DHS-run verification system for employers that has been seen as the holy grail for employment enforcement) for all agricultural employment, Lofgren’s office notes that that would be “phased in" and only "after all legalization and H-2A reforms have been implemented and included necessary due process protections for authorized workers who are incorrectly rejected by the system.” This fuels concerns from immigration hawks that it follows a trend of bills that go "amnesty first, enforcement later."