President Donald Trump's second attempt to ban travel to the U.S. from six Muslim-majority nations was blocked by a federal judge in Hawaii a few hours before it was to go into effect.

Judge Derrick Watson of the U.S. District Court for the District of Hawaii on Wednesday afternoon granted the state of Hawaii a temporary restraining order in its federal lawsuit filed against Trump on March 8, following his new executive order banning travel from Iran, Syria, Somalia, Sudan, Libya and Yemen.

The executive order, signed on March 6, would have prevented the issuance of visas to people from those nations for 90 days and suspended refugee admission for 120 days. The ban was to go in effect at 12:01 a.m. on Thursday.

Trump signed the first travel ban executive order in late January, which would have restricted travel from the six nations and Iraq. That order was halted by a federal judge in February.