Carmen Lopez applauds at Casa de Maryland in Hyattsville, Md., after President Obama's speech about immigration on Thursday, Nov. 20, 2014. (Jose Luis Magana/AP)

Under President Obama’s new program to protect millions of illegal immigrants from deportation, many of those affected will be eligible to receive Social Security, Medicare and a wide array of other federal benefits, a White House official said Tuesday.

In his speech Thursday night, the president touted his plan as a means of bringing accountability to a broken immigration system, under which 11 million or more people are estimated to be living in this country illegally.

“We’re going to offer the following deal: If you’ve with been in America more than five years. If you have children who are American citizens or [legal] residents. If you register, pass a criminal background check and you’re willing to pay your fair share of taxes, you’ll be able to apply to stay in this country temporarily without fear of deportation,” he said. “You can come out of the shadows and get right with the law.”

For those who work, that includes payroll taxes, also known as FICA taxes, because they are collected under the Federal Insurance Contributions Act.

The tax payments are usually split between employer and employee and include 12.4 percent collected to pay for Social Security, as well as 2.9 percent to pay for Medicare.

Federal law says that people who pay the taxes and are deemed “lawfully present in the United States” can collect benefits under those programs when they become eligible. They may also receive survivor and disability benefits.

“If they pay in, they can draw,” White House spokesman Shawn Turner said by e-mail.

Turner noted, however, that the estimated 5 million immigrants granted protection from deportation will not be eligible for other federal benefits such as student financial aid, food stamps or housing subsidies. Nor are they eligible to purchase health insurance through the federal health-care exchange under the Affordable Care Act.

Republicans said Tuesday that they were surprised that illegal immigrants covered by the president’s executive action would be in line to someday receive benefits under Social Security and Medicare, which are the cornerstones of government-provided economic security for elderly Americans.

“First with Obamacare we were told we should pass it and then read it to find out what was in it,” Republican National Committee spokeswoman Kirsten Kukowski said by e-mail. “Now Obama overreached and acted unilaterally on immigration, which should have been vetted and authorized by Congress, and we’re finding out there’s more to the story than Obama and the Democrats originally told Americans.”

Illegal immigrants who register and meet the requirements set out by Obama will be allowed to remain in the United States without fear of deportation for three years at a time. Theoretically, his action could be overturned by future presidents, but withdrawing such arrangements would be difficult politically.

Social Security benefits are based on how much individuals earned during their working careers. This year, more than 59 million people are being paid about $863 billion through the program, with average monthly checks of $1,294 for retirees, $1,146 for disabled workers and $1,244 for survivors.

It is unclear what effect adding millions of immigrants to the Social Security and Medicare systems would have on the two programs, said Robert Shapiro, who was an adviser to President Bill Clinton and now runs an economic consulting firm.

In the short run, he said, it could help the programs’ balance sheets because so many immigrants are still young and would not be drawing benefits.

“The great thing about immigrants, with respect to entitlements, is you get the young worker and you don’t get the young person’s parents,” Shapiro said.

But over the longer haul, he added, they are likely to draw more out of the system than they contribute — as is the case with nearly every Medicare recipient and with many Social Security recipients who worked low-paying jobs.