A federal judge in the United States on Tuesday blocked the implementation of President Donald Trump’s latest travel ban, just hours before it was set to go into full effect, The Washington Post reported.

US District Judge Derrick K Watson from Hawaii said Trump’s order “suffers from precisely the same maladies as its predecessor” and “plainly discriminates based on nationality”. The judge noted that the ban on travellers from eight nations does not show that people coming from these countries would be detrimental to the US.

The latest ban, which was supposed to go into effect early on Wednesday, restricted travellers from North Korea, Venezuela, Chad, Iran, Libya, Syria, Yemen and Somalia. The government said that embassies and consulates across the world had been told to process visas for people from six countries regularly, but it would implement the order for people from Venezuela and North Korea.

The US administration is likely to appeal against Watson’s ruling, the report said. The White House called the judgment “dangerously flawed” and said it “undercuts the president’s efforts to keep the American people safe and enforce minimum security standards for entry into the United States”.

The US Department of Justice will vigorously defend the travel order, which is vital to ensure that foreign nations “comply with the minimum security standards required for the integrity of our immigration system and the security of our nation”, the White House said. “We are, therefore, confident that the judiciary will ultimately uphold the president’s lawful and necessary action and swiftly restore its vital protections for the safety of the American people.”

The earlier travel order, which came into effect on June 30, barred visitors from Iran, Libya, Somalia, Sudan, Syria and Yemen from entering the US. On September 25, the government had decided that besides adding three countries to the order, Iraqis will have to face increased vetting procedures. Restrictions on citizens from Sudan were also lifted.

The ban was scaled back since it was first implemented and blocked by courts in January. There were massive protests and a lot of confusion at US airports after Trump brought the first ban in place, mostly because immigration officers were not allowing anyone in from certain countries, even those with legitimate reasons, green cards and residence permits.

Trump has insisted that the ban is to protect the US from terrorism and to allow immigration officials to vet those entering the US more closely. But his efforts have been seen as part of a separate agenda. While campaigning for presidency, Trump had called for a “total and complete shutdown of Muslims” entering the US.