WASHINGTON (Reuters) - President Barack Obama’s administration on Tuesday delayed implementing his unilateral steps to shield millions of illegal immigrants from deportation after a judge blocked the actions at the urging of 26 states accusing Obama of exceeding his powers.

In a setback to the president, U.S. District Judge Andrew Hanen in Brownsville, a city along the Texas border with Mexico, issued a temporary court order on Monday stopping Obama’s executive actions that bypassed a gridlocked Congress.

Hanen’s action left in disarray U.S. policy toward the roughly 11 million people in the country illegally.

Obama said he disagreed with the ruling and expected his administration to prevail once the issue made its way through the courts.

“The law is on our side and history is on our side,” Obama told reporters in the Oval Office.

The president said the administration will comply with the judge’s order and delay accepting applications from some of the illegal immigrants for deportation relief and work permits that had been set to begin on Wednesday.

“We will be prepared to implement this fully as soon as the legal issues get resolved,” Obama said. He urged Congress to pass legislation to reform the U.S. immigration system more broadly.

Obama said the Justice Department will appeal Hanen’s preliminary injunction to the majority conservative 5th U.S. Circuit Court of Appeals in New Orleans. Hanen has previously issued other opinions critical of the Obama administration’s enforcement of immigration laws.

Hanen’s preliminary injunction is not a ruling on the merits of the lawsuit filed by 26 states, led by Republican bastions such as Texas.

The judge issued his opinion amid a fight in the Republican-led U.S. Congress over legislation passed by the House of Representatives to allow funding for the Department of Homeland Security only if Obama’s immigration actions were nullified. The department is charged with securing U.S. borders, airports and coastal waters.

Neither Republicans nor Democrats showed signs of backing down, especially with the court order being a preliminary one.

The judge hemmed in Obama’s exertion of executive power on Nov. 20 that has drawn the ire of Republican elected officials who say he exceeded his constitutional authority.

“President Obama abdicated his responsibility to uphold the United States Constitution when he attempted to circumvent the laws passed by Congress via executive fiat, and Judge Hanen’s decision rightly stops the president’s overreach in its tracks,” said Republican Texas Governor Greg Abbott.

DEPORTATION RELIEF

Obama’s executive orders would let up to 4.7 million illegal immigrants stay without threat of deportation. It was aimed mainly at helping 4.4 million people whose children are U.S. citizens or legal permanent residents.

About 270,000 people would be able to stay under the expansion of a 2012 program that offered deportation relief to people brought illegally to the United States as children, allowing them work. That expansion had been set to begin on Wednesday.

Immigration lawyers said many applicants for deportation relief under Obama’s order had already filed paperwork and the required $465 fee ahead of the beginning of the first stage of the executive action. They now must decide whether to withdraw their applications and be refunded, or continue in hopes the injunction is overturned.

Maria, 18, who is an undocumented migrant from Central America, looks out of a window in Los Angeles, California, July 22, 2014. REUTERS/Lucy Nicholson

Obama’s administration billed his moves as the biggest immigration policy shift since 1986 changes passed under President Ronald Reagan. Immigration policy is certain to become an important topic in the 2016 presidential campaign.

Most of the illegal immigrants in the United States come from Mexico and other Latin American countries. Guatamala, Honduras, El Salvador and Mexico said they were disappointed with the Texas judge’s order.

Mexico’s Foreign Ministry said Obama’s moves provided “a just migration solution for millions of families and could reinforce the significant contributions of Mexican migrants to the American economy and society.”

The judge wrote that the administration had not complied with procedures needed for putting into effect Obama’s immigration moves, which he made after House Republicans blocked bipartisan immigration legislation passed by the Senate in 2013.

In his opinion, Hanen wrote that “the states have clearly proven a likelihood of success on the merits” of the case. Hanen wrote it was “disingenuous” for the administration to maintain Obama’s actions merely “supplements and amends” current policy.

“It represents a massive change in immigration practice, and will have a significant effect on, not only illegally present immigrants, but also the nation’s entire immigration scheme and the states who must bear the lion’s share of its consequences,” Hanen wrote.

Republicans argue that Obama often has overstepped his presidential authority in areas also including U.S.-Cuba policy and changes in his signature healthcare law.

In aiming to thwart Obama’s moves on immigration, they risk further alienating Hispanic voters and being accused of interfering with counterterrorism efforts by holding up money for homeland security. Republicans say there will be no interruption in the homeland security agency’s critical protective missions.

(Corrects spelling to Guatemala from ‘Guatamala’ in paragraph 18)