A United States district judge has ruled President Donald Trump's executive order on immigration violates the Constitution and has granted a preliminary injunction against the order, according to court documents.

In the document, U.S. District Judge Leonie Brinkema said there is evidence that the president’s travel ban violates the First and Fifth Amendments and would cause "irreparable injury" to Virginia residents, Virginia institutions and persons connected to those persons and institutions.

In her conclusions after the oral arguments, she wrote, "Maximum power does not mean absolute power. Every presidental action must still comply with the limits set by Congress' delegation of power and the constraints of the Constitution, including the Bill of Rights."

Brinkema based her decision on several incidents, including the president calling for a "Muslim ban" during the campaign and his statements of helping persecuted Christians, making them a priority for help. She also pointed to evidence the president did not consult with experts on immigration.

"To the contrary, there is evidence that the president's senior national security officials were taken by surprise," she wrote, adding the people involved in crafting the order was not privy to any national security information while developing the policy.

She agreed with the state's contention that it would suffer irreparable harm if the executive order were to stand. She wrote the likelihood of an Establishment Clause violation and the restraint on liberty imposed by the ban on students and faculty of the Commonweath's universities were sufficient to establish harm by the executive order.

"Enjoining unconstitutional action by the Executive Branch is always in the public's interest," Brinkema wrote.

The judge did limit the scope of the injunction to just Virginia, pointing out there is a nationwide temporary restraining order being sought in Washington state that would provide the broader protection being sought by the state.

Attorney General Mark Herring praised the ruling, calling the president's order "unlawful, unconstitutional, and un-American."

"We presented a mountain of evidence showing this was the 'Muslim ban' that President Trump promised as a candidate, while his administration failed to refute one shred of our evidence or provide any of its own to support its claims," Herring said in a statement. "The overwhelming evidence shows that this ban was conceived in religious bigotry and is actually making Americans and our armed forces less safe at home and abroad. This preliminary injunction will protect Virginians while our case is pending, and the opinion explaining it lays out in stunning detail the extent to which the Court finds this order to likely violate the First Amendment of the U.S. Constitution."

A federal appeals court in California has already upheld a national temporary restraining order stopping the government from implementing the ban, which is directed at seven Muslim-majority countries. But the preliminary injunction issued by Brinkema is a more permanent type of injunction than the temporary restraining order issued in the Washington state case.