The U.S. government asked a federal judge Monday to lift a temporary hold on President Barack Obama's executive action on immigration.

Obama made an executive action that would protect millions of undocumented immigrants from deportation. His action was later blocked by a Texas District Judge Andrew Hanen.

The federal government filed a three-page notice with Hanen and said it is appealing his decision to the 5th U.S. Circuit Court in New Orleans, The Associated Press reports

Hanen issued a preliminary injunction sought by 26 states suing to stop Obama's executive action claiming it is unconstitutional. The states led by Hanen also said shielding 5 million immigrants from deportation would force states to invest more on law enforcement, health care and education.

Obama's immigration would be allowed to go forward while the lawsuit proceeds if Hanen puts his ruling on hold during the appeal to the 5th Circuit.

Justice Department attorneys said a stay of Hanen's ruling is necessary "to ensure that the Department of Homeland Security is able to most effectively protect national security, public safety and the integrity of the border." 

Yet, government lawyers say Hanen lacked the authority to issue the injunction.

White House press spokesman Josh Earnest said the injunction issued by Hanen should only focus on Texas "so that we can move forward with these executive actions in other states." 

"We will continue to oppose attempts by the Obama Administration to implement its executive amnesty scheme that undermines the rule of law, mocks the principles of democracy and defies the U.S. Constitution," Texas Attorney General Ken Paxton said.

Obama warned his administration would appeal Hanen's decision because he disagreed with it, USA Today reports.

"The law is on our side and history is on our side," Obama said adding his actions to defer deportations for potentially millions of migrants will improve a broken immigration system.

Undocumented immigrants cannot apply for legal status until Hanen's ruling is overturned on appeal.