Jose Medellin is scheduled for execution in less than three weeks
The US has been advised not to execute five Mexican nationals on death row by the International Court of Justice.
The ICJ - the UN's highest court - had previously ruled that the men had been denied the right to help from their consulate after their arrests.
A 2005 ruling by President George W Bush that the cases should be reviewed was overturned by the US Supreme Court. But the Hague-based court told the US it should not execute the men before it made its final judgement.
In a majority ruling, the ICJ said the US should "take all measures necessary to ensure (they) are not executed pending judgment... unless and until these five Mexican nationals receive review and reconsideration (of their sentences)".
Mexico welcomed the ruling.
Jorge Lomonaco Tonda, representing Mexico at the court, said: "The Mexican government is satisfied with the ruling of the court... we have full confidence that the ruling will be applied."
The five are among 51 Mexicans on death row in the US who were not told after arrest that they were entitled to assistance from Mexican consulates - in violation of the 1963 Vienna Convention.
All five are currently on death row in Texas.
Set up in 1946, the ICJ is the highest United Nations court
One of them, 33-year-old Jose Medellin, is scheduled for execution in less than three weeks for his part in the gang rape and murder of two teenage girls in 1993.
A statement issued by the office of Texas Attorney General Greg Abbot said it considered the law in Medellin's case to be "clear".
"Texas is bound not by the World Court, but by the US Supreme Court, which reviewed this matter and determined that the convicted murderer's execution shall proceed," the statement said.
"Today's development in a foreign tribunal comes just months after this nation's highest court plainly rejected both Medellin's legal claims - and the World Court's earlier attempts to bind our justice system."
In a ruling that set Mr Bush at loggerheads with his home state, the president had ordered Texas to comply with an ICJ ruling made in 2004 that all the convicted men should get new hearings.
However, the US Supreme Court justices decided 6-3 that he had overstepped his authority.
After the executions were cleared to proceed in the US, Mexico went back to the world court last month to stop the sentences from being carried out.
The ICJ is the highest United Nations court. Set up in 1946, it offers advisory opinions to international disputes brought to it by member states.