In a primetime speech, President Barack Obama used emotional appeals and invoked scripture to announce sweeping executive action allowing nearly 5 million illegal immigrants to register for background checks, pay back taxes and not have to worry about deportations for three years.

President Barack Obama speaks in the East Room of the White House in Washington, Thursday, Nov. 20, 2014, during a ceremony to award the National Medals of Science, and the National Medals of Technology and Innovation. The awards are the highest honor bestowed by the United States Government upon scientists, engineers, and inventors. (AP Photo/Evan Vucci)

AP

“Even as we are a nation of immigrants, we are also a nation of laws,” Obama said. “Undocumented workers broke our immigration laws, and I believe that they must be held accountable – especially those who may be dangerous.”

Under the actions, the focus of deportations will be on criminals and recent illegal border crossings. Under the executive action, the Department of Homeland Security will place anyone suspected of terrorism, violent crimes, gang members and recent illegal border crossers at the top of the deportation list.

“We’re going to keep focusing enforcement resources on actual threats to our security. Felons, not families, criminals, not children, gang members, not a mother who’s working hard to provide for her kids,” Obama said. “We’ll prioritize, just like law enforcement does every day.”

Obama talked further about a tradition of welcoming immigrants.

“Scripture tells us that we shall not oppress a stranger, for we know the heart of a stranger – we were strangers once, too,” Obama said. “My fellow Americans, we are and always will be a nation of immigrants. We were strangers once, too.”

Obama acknowledged that critics call the deportation relief amnesty, which he disagreed with.

“Amnesty is the immigration system we have today, millions of people who live here without paying their taxes or playing by the rules, while politicians use the issue to scare people and whip up votes at election time,” Obama said. “Mass amnesty would be unfair. Mass deportations would be both impossible and contrary to our character.”

“What I’m describing is accountability, a commonsense, middle ground approach,” Obama continued.  ”If you meet the criteria, you can come out of the shadows and get right with the law. If you’re a criminal, you’ll be deported. If you plan to enter the U.S. illegally, your chances of getting caught and sent back just went up.”

Under the executive action, illegal immigrants who have been in the United States for more than five years and have children who are U.S. citizens or legal residents will be allowed to come forward and register for the background checks. This aspect would allow “just north of 4 million” illegal immigrants to remain in the country, a White House senior official said.

Many Republicans assert that Obama’s action without Congress is constitutionally questionable. Obama has said he is taking action because Congress won’t act. In June, Obama asked Attorney General Eric Holder and Homeland Security Secretary Jeh Johnson to review what the executive branch can do ab without Congress.

“The actions I’m taking are not only lawful, they’re the kinds of actions taken by every single Republican president and every single Democratic president for the past half century,” Obama said. “And to those members of Congress who question my authority to make our immigration system work better, or question the wisdom of me acting where Congress has failed, I have one answer: pass a bill.”

On another front, the president is also expand the deferred action for childhood arrivals program, or DACA, which could add another 300,000.

The expansion will eliminate the age cap from the 2012 DACA that was for no one older than 31. Also, the 2012 DACA program was for childhood arrivals who came to the United States before January 2007. That will be moved to anyone who came United States before January 2010. This group will also be exempt from deportation for three years.

The order will also include a package of immigration court reforms and expand visas for illegal immigrants who are victims of crimes or human trafficking if they cooperate with government investigators. White House officials said the shielding from deportation and work permits for illegal immigrants are temporary and revokable.

“Are we a nation that accepts the cruelty of ripping children from their parents’ arms? Or are we a nation that values families, and works to keep them together?” Obama asked. ”Are we a nation that educates the world’s best and brightest in our universities, only to send them home to create businesses in countries that compete against us? Or are we a nation that encourages them to stay and create jobs, businesses, and industries right here in America?”

The administration considered giving legal status not only to parents of legal residents, but also parents of illegal immigrants shielded under DACA. However, the Justice Department’s Office of Legal Counsel’s opinion said, “DHS’s proposed prioritization policy and its proposed deferred action program for parents of U.S. citizens and lawful permanent residents would be legally permissible, but that the proposed deferred action program for parents of DACA recipients would not be permissible.”

The legal opinion said out of the estimated 11 million illegal immigrants, Homeland Security only has the resources to remove fewer than 400,000.

“Whether our forebears were strangers who crossed the Atlantic, or the Pacific, or the Rio Grande, we are here only because this country welcomed them in, and taught them that to be an American is about something more than what we look like, or what our last names are, or how we worship,” Obama said.

This post has been updated to include Obama’s speech, information on a legal opinion from the Justice Department and information from a briefing available after the 6 p.m. embargo.