A second judge has blocked President Trump's new travel ban on the grounds that the comments he made when he was a candidate indicated this executive order was an attempt to unconstitutionally ban Muslim immigrants.

U.S. District Judge Theodore D. Chuang of Maryland issued a preliminary injunction and ruled the administration should allow those from Syria, Libya, Iran, Yemen, Chad, Somalia, North Korea and Venezuela into the U.S. if they have a "bone fide" relationship with a person or entity in the country. But he upheld the other component that blocks all others in the eight-country travel ban, according to a report.

On Tuesday, a federal judge in Hawaii blocked Trump's newest attempt to implement the ban, hours before it was scheduled to take effect at midnight. U.S. District Court Judge Derrick K. Watson issued a temporary restraining order on Trump's third executive order.

The Justice Department said it would appeal the decision.

The new executive order and guidance, which the Trump administration developed last month, added Chad, Venezuela and North Korea to the list of countries whose citizens may not travel to the U.S. However, only Venezuelan government officials were blocked.

Watson on Tuesday did not make a decision on travel from North Korea and Venezuela because the plaintiffs did not challenge it.

Nearly two dozen advocacy groups brought the Maryland case on behalf of seven people who they said would be hurt by Trump's latest order.

Lower federal courts have blocked all of Trump's attempts to implement the travel ban aimed at various countries of predominantly Muslim populations. The Supreme Court allowed a limited version of the ban to proceed this summer and scheduled arguments in October over the travel ban controversy, but later dismissed the case because the ban had expired.

The White House has said the affected countries have a way to get off its travel ban list.

"The restrictions being imposed on these eight countries are conditional and may be lifted as they work with the U.S. government to ensure the safety of Americans," a White House statement stated. "We look forward to all countries meeting the new requirements for cooperation with the United States as we continue to take steps necessary to protect our national security."

Ryan Lovelace contributed.