A federal judge on Wednesday blocked President Donald Trump’s second attempt at a ban on travel to the United States from predominantly Muslim countries, issuing a temporary restraining order that applies nationwide. The ban was set to go into effect at midnight.

The temporary restraining order blocks the Trump administration from enforcing sections 2 and 6 of the new executive order — the travel and refugee portions of the order.

“Any reasonable, objective observer would conclude, as does the Court for purposes of the instant Motion for TRO, that the stated secular purpose of the Executive Order is, at the very least, ‘secondary to a religious objective’ of temporarily suspending the entry of Muslims,” US District Judge Derrick Watson wrote in granting the TRO.

Watson was one of three judges hearing challenges to the travel ban today; other judges in Maryland and Washington also heard arguments.

The ruling comes after federal courts blocked Trump’s first attempt at a Muslim travel ban, issued January 27, which went into effect immediately and sparked protests nationwide. Trump then quietly issued another ban, more narrowly drawn and designed to pass Constitutional muster.

The restraining order will likely remain in effect until suits against the ban can run their course.