A federal judge in Hawaii blocked most of President Trump’s latest version of a travel ban Tuesday, just hours before it was set to take effect. U.S. District Judge Derrick Watson, who previously blocked plans by the administration to ban refugees and travelers from six majority-Muslim nations, ruled the latest ban “plainly discriminates based on nationality” in violation of the law as well as the “founding principles of this Nation.”

The ban would have barred some travelers from Chad, Iran, Libya, North Korea, Somalia, Syria and Yemen. However, Judge Watson’s order will allow a ban on some North Koreans and Venezuelans to go into effect. The Supreme Court was scheduled to hear arguments this month on an earlier version of a travel ban but canceled the hearing after Trump issued new restrictions. The White House has vowed to appeal the latest ruling.