WASHINGTON — Millions of immigrants benefiting from President Barack Obama’s executive actions could get a windfall from the IRS, a reversal of fortune after years of paying taxes to help fund government programs they were banned from receiving.

Armed with new Social Security numbers, many of these immigrants who were living in the U.S. illegally now will be able to claim up to four years of tax credits designed to benefit the working poor.

For big families, that’s a maximum of nearly $24,000, as long as they can document their earnings during those years.

Some Republicans label the payments as “amnesty bonuses,” one more reason they oppose Obama’s program shielding millions of immigrants from deportation.

“I represent hardworking, law-abiding Texans,” said Rep. Sam Johnson, a senior Republican on the House Ways and Means Committee. “I think these amnesty rewards, and that’s what they are, need to be stopped.”

Advocates argue that many of these immigrants pay taxes, so they should be able to claim the same tax credits as anybody else. In the past decade, immigrants who are in the U.S. illegally have paid an estimated $100 billion of Social Security payroll taxes, even though few will ever be able to collect benefits, said Stephen Goss, Social Security’s chief actuary. Obama issued executive orders shielding about 4 million immigrants from deportation. Some were brought to the U.S. as children; others are parents of children who are U.S. citizens or legal residents.

The dispute over tax credits illustrates the complicated relationship that many immigrants have with the U.S. tax system. Social Security estimates that immigrants living in the country illegally work at about the same rate as the rest of the population, even though federal law bars them from employment.

In general, they are less likely to pay federal taxes. Those who do have been boosting Social Security’s finances for years.

The numbers are huge. From 2003 to 2012, the total was nearly $750 billion in wages. Only 7 percent of these wages are ever claimed and credited to an actual worker, Goss said.

There are an estimated 11 million to 12 million immigrants in the U.S. illegally. By law, you must have a Social Security number to work in the U.S. But millions of people work without them.

They can claim some federal tax breaks if they file tax returns. But until now, they were not eligible for Social Security, Medicare or the Earned Income Tax Credit, also called EITC, one of the government’s largest anti-poverty programs.

Obama’s executive actions will offer Social Security numbers to these immigrants, something that eventually could make them eligible for Social Security and Medicare. More immediately, they can take advantage of the EITC. Last year, the credit provided low-income workers with about $70 billion.

This credit is popular among conservatives because it rewards work — the more you work, the bigger your credit, as long as your income does not exceed certain limits. It is popular among liberals because it provides cash payments to low-wage workers, even if they do not make enough money to pay federal income tax.

It is, however, a complicated program to administer that generates a significant amount of improper payments, according to the IRS’s own estimates.

Once the immigrants in Obama’s program get Social Security numbers, they can file tax returns claiming the EITC, as long as they meet income requirements and can document their earnings.

They also can file amended tax returns for up to three years after they were due, which means these immigrants can claim tax credits going back as far as 2011.

The maximum credit for families with three or more children is about $6,000, so some families could get as much as $24,000 in credits.

IRS Commissioner John Koskinen said these tax returns would be processed just like any other.

“You have to do the same thing any taxpayer would do, which is you’re going to file a return, say this is what I earned, these are my expenses, deductions, whatever it might be,” Koskinen said. “You have to have the supporting documentation.”

Some in Congress are outraged.

“The administration may have blown open the doors for fraud with amnesty bonuses of more than $24,000 to those who receive deferred action,” said Sen. Ben Sasse, R-Neb. “This program severely undermines the White House’s lip-service to enforcing the law and would increase the burden on law-abiding taxpayers.”

Advocates for immigrants say that if these workers are paying taxes, they should get the same benefits as other taxpayers.

“Let’s not forget that these workers receive the lowest wages for what they contribute to their communities and local economies,” said Ellen Sittenfeld Battistelli, policy analyst at the National Immigration Law Center. “What do we, as a nation, gain by further impoverishing them?”