The ruling puts on hold Obama's orders that could spare as many as five million people who are in the US illegally from deportation.
It came from US District Judge Andrew Hanen, who once accused the Obama administration of participating in criminal conspiracies to smuggle children into the U.S. By helping reunite them with parents who live here illegally.
The decision does not judge the merits of the case, but it is a blow to a key Obama initiative that infuriated Republicans.
"The district court's decision wrongly prevents these lawful, commonsense policies from taking effect," the statement said.
The US Department of Justice will appeal the ruling, the White House said.
Obama took the sweeping measures November, saying he had to act because comprehensive, bilateral legislation to reform the country's immigration system was stalled in the Republican-controlled House.
Republicans leaders said Obama's unilateral move would only make it more difficult to get bipartisan legislation through Congress.
House Speaker John Boehner said Hanen's ruling underscores that Obama acted beyond his authority and said he hoped Senate Democrats will relent in their opposition to the Homeland Security Spending bill.
The first of Obama's orders to expand a program that protects young immigrants from deportation if they were brought to the US illegally as children was set to start taking effect tomorrow.
The other major part of Obama's order, which extends deportation protections to parents of US citizens and permanent residents who have been in the country for some years, was not expected to begin until May 19.
