President Donald Trump’s revised travel ban was suspended indefinitely by a US federal judge in Hawaii overnight.

Judge Derrick Watson’s ruling means Trump will be barred from enforcing the ban on six mostly Muslim nations while it is contested in court.

The US state said in a lawsuit that the ban would harm tourism and the ability to recruit foreign students and workers.

Judge Watson made the ruling late on Wednesday after hearing arguments from attorneys for the state of Hawaii and the US Department of Justice, the BBC reported.

The judge turned his earlier temporary restraining order into a preliminary injunction that would have a more lasting effect.

President Trump’s executive order on March 6 would have placed a 90-day ban on people from Iran, Libya, Somalia, Sudan and Yemen and a 120-day ban on refugees.

An earlier version of the order, issued on January 27, sparked confusion and protests, and was blocked by a judge in Seattle.

Other courts across the US have issued different rulings on Trump’s revised ban, with a judge in Maryland halting a part of it earlier this month.

Trump has complained of “unprecedented judicial overreach”, pledging to take the case “as far as it needs to go”.

An appeal against the Hawaii decision would be expected to go next to the Ninth Circuit Court of Appeals – the same court which in February said it would not block a ruling by a Seattle court to halt the original travel ban.

Trump claims the travel ban seeks to prevent terrorists from entering the US.