Image copyright Getty Images Image caption Mr Trump's executive powers have defined limits, a Virginia judge has pointed out

A US district judge in Virginia has ruled that President Donald Trump's executive order barring entry from seven countries is unconstitutional.

Judge Leonie Brinkema issued a preliminary injunction, asserting that the campaign vow to institute a "Muslim ban" violated the First Amendment.

The Monday ruling is significant, as the judge ruled that religious bias is at the heart of Mr Trump's ban.

Judges elsewhere have already upheld an order stopping implementation.

The First Amendment prohibits the government from establishing laws that favour one religion over another.

Earlier this month an appeals court upheld a lower court's decision to bar the federal government from beginning implementation of the ban, which temporarily prohibits travel from seven Muslim-majority countries, and indefinitely suspends the refugee admissions programme.

Image copyright Getty Images Image caption Protests broke out at US airports, including here in Virginia, after Mr Trump announced the ban

In her 22-page ruling, the Virginia judge cited several of Mr Trump's campaign statements including those in which he promised to create a "Muslim ban" if he were elected president.

"The president himself acknowledged the conceptual link between a Muslim ban and the EO (executive order)," Judge Brinkema wrote.

She also criticised the president's statements that persecuted Christians may be permitted entry despite the ban, which she said amounts to a religious test.

She also referenced a Fox News interview in which former New York City Mayor Rudy Giuliani, a Trump adviser, said that the president wants a "Muslim ban" and that he had been instructed by Mr Trump to put together a commission to determine "the right way to do it legally".

Judge Brinkema sharply criticised lawyers for the justice department, who she said did not present any evidence except for the president's executive order.

"Maximum power does not mean absolute power," she wrote. "Every presidential action must still comply with the limits set" by the separation of powers laid out in the US Constitution.

Virginia Attorney General Mark Herring, who argued the case against the ban, praised the judge's decision saying "the overwhelming evidence shows that this ban was conceived in religious bigotry".

The temporary injunction applies only to residents of Virginia and faculties of state universities who may have been affected by the new travel restrictions.

The case was brought to the court in Alexandria, Virginia, on behalf of two Yemeni brothers who were turned away from the US shortly after arriving at Dulles International Airport.

The Yemeni men have since been allowed to enter the United States.

Mr Trump has said that he is considering rewriting the executive order, rather than bring the case to the Supreme Court.