WASHINGTON — President Trump’s third attempt to ban travel from several predominantly Muslim nations met the same fate Tuesday as the first two: It was blocked nationwide by a federal judge in Hawaii.

The ban, which was to go into effect Wednesday, “suffers from precisely the same maladies as its predecessor,” Judge Derrick Watson wrote. “It lacks sufficient findings that the entry of more than 150 million nationals from six specified countries would be ‘detrimental to the interests of the United States,'” and it “plainly discriminates based on nationality.”

The 40-page ruling will be appealed by the Justice Department, but it throws a monkey wrench into the administration’s plans on the eve of the latest ban taking effect.

The White House called Watson’s ruling “dangerously flawed” and a threat to national security. It said the latest version of the travel ban was a carefully constructed measure implemented after a thorough review by the departments of Homeland Security, State, Defense and Justice. 

“These restrictions are vital to ensuring 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 statement said.

Trump’s earlier bans, from January and March, were struck down by several federal courts before the Supreme Court allowed part of the second ban to take effect in late June. That ban expired last month, to be replaced by an indefinite prohibition against some travelers from an expanded group of countries.

Trump’s third version blocks specific travelers from five of the original nations — Iran, Libya, Somalia, Syria and Yemen — along with Chad, North Korea and Venezuela. Iraq and Sudan were subtracted from the list in March and September, respectively.

Tuesday’s ruling affects only the six…