Story highlights Federal judge who blocked Obama immigration executive actions delayed his order to turn over immigration records of 50,000 people

Had also ordered DOJ lawyers take ethics courses

Will hear challenge to order in August

(CNN) A federal judge Tuesday agreed to stay his order that the Obama administration turn over immigration records of over 50,000 people and require Justice Department lawyers attend ethics courses.

In a one-page order, Judge Andrew Hanen of the U.S. District Court for the Southern District of Texas said he will hear a challenge to his controversial order on August 22.

The dispute began last month, when Hanen -- the federal judge who temporarily blocked President Barack Obama's controversial executive actions on immigration last year -- issued the scathing order accusing the government of making misrepresentations to him when he heard the immigration case in 2015. The order did not impact the President's executive actions, which are currently before the Supreme Court.

Last week, administration lawyers asked Hanen to stay his ruling saying they "emphatically" disagreed with the sanctions and would appeal the matter to the 5th Circuit Court of Appeals.

Separately, immigration rights groups expressed outrage that the judge was asking for records of those that participated in a 2012 program called Deferred Action for Childhood Arrivals (DACA) who are not a party to the case. The groups say the order is a threat to DACA recipients' privacy.

Read More