WASHINGTON — The Supreme Court on Tuesday said it will decide whether President Barack Obama has the authority to declare that millions of illegal immigrants be allowed to remain and work in the United States without fear of deportation.

The court will probably hear the case in April, with a ruling before it adjourns in June. It provides the last chance that the administration would have to implement the program, announced by Obama in 2014, before he leaves office next January. The program would affect nearly 4 million people.

Obama’s program, called Deferred Action for Parents of Americans and Lawful Permanent Residents, would allow illegal immigrants in those categories to remain in the country and apply for work permits if they have been here for at least five years and have not committed felonies or repeated misdemeanors.

The administration says the program is a way for a government with limited resources to prioritize which illegal immigrants it will move first to deport.

But the executive action, taken after Congress failed to enact comprehensive immigration reform, was blocked by lower courts when Texas and 25 other Republican-led states sued to stop it.

“DAPA is a crucial change in the nation’s immigration law and policy – and that is precisely why it could be created only by Congress, rather than unilaterally imposed by the Executive,” Texas Attorney General Ken Paxton, a Republican, said in a filing to the court.

The states said that the program “would be one of the largest changes in immigration policy in our nation’s history” and that it raises major issues involving the separation of powers and federalism.

Paxton on Tuesday welcomed the Supreme Court review, saying in a statement: “In deciding to hear this case, the Supreme Court recognizes the importance of the separation of powers. As federal courts have already ruled three times, there are limits to the President’s authority, and those limits enacted by Congress were exceeded when the President unilaterally sought to grant ‘lawful presence’ to more than 4 million unauthorized aliens who are in this country unlawfully.”

White House officials also welcomed the announcement, saying they were confident their side would prevail. White House assistant press secretary Brandi Hoffine said in an email the case affects “immigrants who want to be held accountable, to work on the books, to pay taxes, and to contribute to our society openly and honestly.”

“The policies will make our communities safer. They will make our economy stronger. And they are consistent with the actions taken by presidents of both parties, the laws passed by Congress, and the decisions of the Supreme Court. We are confident that the policies will be upheld as lawful,” she said.

The immigration issue has confounded a politically deadlocked Congress and has emerged as one of the major flash points of disagreement between the Democrats and Republicans running for president.

The administration contends that the states have no legal standing to sue because it is up to the federal government to set immigration policy and that the Department of Homeland Security did not violate federal statutes in devising the program.

Setting priorities about whom to deport is a practical response to the fact that Congress has given the administration only enough money to deport no more than about 400,000 of the nation’s estimated 11 million illegal immigrants, the government says.

In the administration’s petition to the court, U.S. Solicitor General Donald Verrilli said that the lower courts had blocked “a federal immigration enforcement policy of great national importance” and that they did so “in violation of established limits on the judicial power. If left undisturbed, that ruling will allow states to frustrate the federal government’s enforcement of the nation’s immigration laws.”

Verrilli said that lower-court rulings “will force millions of people – who are not removal priorities under criteria the court conceded are valid, and who are parents of U.S. citizens and permanent residents – to continue to work off the books, without the option of lawful employment to provide for their families.”

A federal district court and then two panels of the U.S. Court of Appeals for the 5th Circuit in New Orleans agreed with the states’ arguments. Both courts have kept the program from being implemented.

The justices also added a question about the constitutionality of Obama’s actions. Texas had argued that Supreme Court precedent requires that “presidential action that lacks congressional support must be scrutinized with caution.”

Supporters of the administration’s policy welcomed the justices’ decision to take up the case, saying it is the only way to resolve the status of millions of undocumented immigrants.

“The president’s program has been delayed for far too long by this political lawsuit and the clearly erroneous decisions of the lower courts,” said Elizabeth Wydra, chief counsel of the Congressional Accountability Center. “The lives of millions of children and families in America have been disrupted and held in limbo – a situation the president’s action was designed to alleviate – and they deserve the Court’s careful and prompt attention.”

Brenda Guigui, a U.S. citizens whose parents are undocumented, said: “My parents are ready to apply for DAPA as soon as the court lets the program begin.. . I know there are legal issue but for us it’s personal.

“Unfortunately, the national politics are ugly. Millions of immigrants have made their lives here and have children who are citizens.”

The case is United States v. Texas.

The Washington Post’s Juliet Eilperin and David Nakamura contributed to this story.