WASHINGTON (Reuters) - The U.S. Supreme Court on Tuesday paved the way for a major ruling on the limits of presidential powers, agreeing to decide the legality of President Barack Obama’s unilateral action to shield more than 4 million illegal immigrants from deportation.

A man holds an envelope from the U.S. Citizenship and Immigrations Service during a naturalization ceremony at the National Archives Museum in Washington December 15, 2015. REUTERS/Carlos Barria

The court agreed to hear Obama’s bid to resurrect his plan, undertaken in 2014 through executive action bypassing the Republican-led Congress, that was blocked last year by lower courts after Texas and 25 other Republican-governed states sued to stop it. A ruling is due by the end of June.

The case is not the first time Obama has asked the Supreme Court to rescue a major initiative. The court in 2012 and 2015 rejected conservative challenges to his signature healthcare law.

The White House expressed confidence the court would now deem as lawful Obama’s immigration action, which was crafted to let millions of illegal immigrants whose children are American citizens or lawful permanent residents to get into a program that protects them from deportation and supplies work permits.

Texas and the other states contend Obama exceeded his presidential powers and usurped the authority of Congress. Texas Attorney General Ken Paxton, a Republican, said courts have long recognized the limits to presidential authority.

“The court should affirm what President Obama said himself on more than 20 occasions: that he cannot unilaterally rewrite congressional laws and circumvent the people’s representatives,” Paxton said.

The nine justices will review a November ruling by the New Orleans-based 5th U.S. Circuit Court of Appeals that upheld a February 2015 decision by U.S. District Judge Andrew Hanen in Brownsville, a city along the Texas border with Mexico, to halt Obama’s action.

With some of his major legislative initiatives suffocated by Republican lawmakers, the Democratic president has resorted to executive action to get around Congress on issues including immigration, gun control and the Obamacare law. The most recent executive action came this month when he acted unilaterally to expand background checks for certain gun purchases.

His executive actions have antagonized Republicans who accuse him of unlawfully taking actions by executive fiat that only Congress can perform.

The case raises several legal issues, including whether states have legal standing to sue the U.S. government over decisions on how to enforce federal laws.

‘FAITHFULLY EXECUTED’

The high court added a separate question on whether the president’s action violated a provision of the U.S. Constitution that requires the president to “take care that the laws be faithfully executed.”

The Obama administration called the president’s action mere guidance to immigration officials on how to exercise discretion given by Congress on how to enforce immigration laws.

Obama’s action was “consistent with the actions taken by presidents of both parties, the laws passed by Congress and the decisions of the Supreme Court,” White House spokeswoman Brandi Hoffine said.

Those eligible for Obama’s program, directed at illegal immigrants with no criminal record, would be able to work legally and receive some federal benefits. States were not required to provide any benefits. His order expanded on a 2012 program that provided similar relief for people who became illegal immigrants as children.

The case could have repercussions beyond immigration because it would set a precedent for the circumstances under which states can sue the federal government over a range of executive actions. Future presidents, Republican or Democratic, could face new constraints if the states win.

The case is one of the most important the Supreme Court will decide during its current term, along with a challenge to a restrictive Texas abortion law.

Slideshow ( 4 images )

If the court sides with Obama, he would have until his term ends in January 2017 to implement the immigration plan. With the U.S. presidential election looming in November, it would be up to the next president to decide whether to keep it in place.

Obama’s action came after a bipartisan immigration policy overhaul bill passed by the Senate died in the House of Representatives.

The immigration issue has driven a wedge between Hispanics, an increasingly important voting bloc, and Republicans, many of whom have offered tough words about illegal immigrants. Most of the estimated 11 million illegal immigrants are Hispanics, coming from Mexico and other Latin American countries.

The ruling is due just months before the presidential election. The two leading Democratic presidential hopefuls, Hillary Clinton and Bernie Sanders, said on Tuesday the court should uphold Obama’s action. Republican candidates Ted Cruz and Marco Rubio said as president they would undo Obama’s immigration moves.

Senate Democratic Leader Harry Reid said Obama’s executive action relied on well-established constitutional authority.

He said he recently met with the illegal immigrant parents of U.S citizens and lawful permanent residents, saying that “these law-abiding men and women continue to live in constant fear of being separated from their children. These families must be allowed to step out of the shadows and fully contribute to the country that they love and call home.”