A federal judge blocked Donald Trump's attempt to restrict birthright citizenship in the United States on Thursday as liberal states scored their first victory against the new president's hardline agenda.
The ruling imposes a 14-day stay on the enforcement of one of the most controversial executive orders Trump signed in the hours after he was sworn into office for a second term.
"This is a blatantly unconstitutional order," US District Judge John Coughenour was reported as saying during the hearing in Washington state.
"I've been on the bench for over four decades, I can't remember another case where the question presented is as clear as this one is," said Coughenour, who was appointed by a Republican president, Ronald Reagan.
Trump told reporters his administration would "obviously" appeal the ruling, while the Department of Justice said it would defend the executive order, which a spokesman said "correctly interprets" the US Constitution.
"We look forward to presenting a full merits argument to the court and to the American people, who are desperate to see our nation's laws enforced," the spokesman said.
Birthright citizenship is enshrined in the US Constitution under the 14th Amendment which decrees that anyone born on US soil is a citizen.
It says, in part: "All persons born or naturalized in the United States, and subject to the jurisdiction thereof, are citizens of the United States and of the State wherein they reside."
Trump's order was premised on the idea that anyone in the United States illegally, or on a visa, was not "subject to the jurisdiction" of the country, and therefore excluded from this category.
An incredulous Coughenour chided Justice Department attorney Brett Shumate over his assertion that Trump's order was constitutional.
"Frankly, I have difficulty understanding how a member of the bar could state unequivocally that this is a constitutional order," Coughenour said.
"It just boggles my mind."
The ruling comes after a flurry of lawsuits filed by 22 states, two cities and numerous civil rights groups.
It was hailed by states that took part in the legal actions.
"No president can change the constitution on a whim and today's decision affirms that," Arizona Attorney General Kris Mayes said.
The ruling is "the first of many wins to come as my office fights instances of executive overreach and any illegal actions the new administration may take."
Washington Attorney General Nick Brown said Trump's order was "un-American."
"Birthright citizenship makes clear that citizenship cannot be conditioned on one's race, ethnicity or where their parents came from," he said after the ruling.
"It's the law of our nation, recognised by generations of jurists, lawmakers and presidents, until President Trump's illegal action."
The legal challenge was no surprise, and Trump had acknowledged it was likely when he signed the order.
He has repeatedly – and wrongly – asserted that the United States is the only country in the world with birthright citizenship; in fact more than 30 others also have it, including Canada and Mexico. (AFP)