Medellin's case pitted President Bush against his home state

Jose Ernesto Medellin was sentenced to death in 1994 for rape and murder.

In 2004, an international court said he and 50 other Mexicans should get new hearings as they had had no access to consular officials upon their arrest.

Mr Bush ordered Texas to comply but the Supreme Court justices decided 6-3 that he had overstepped his authority.

Tuesday's ruling comes in a case that had set Mr Bush against his home state.

Although the Bush administration objected to the ruling by the International Court of Justice (ICJ), the president wrote a memorandum ordering the state courts to comply.

He said the ICJ's decision must be carried out because the US had agreed to abide by the court's rulings in such cases.

Supreme Court Chief Justice John Roberts, writing for the majority, said the ICJ's decision could not be forced upon the states.

The president may not "establish binding rules of decision that pre-empt contrary state law", Mr Roberts wrote.

Consular assistance

Medellin was arrested in June 1993, a few days after the killings of Jennifer Ertman, 14, and Elizabeth Pena, 16. He later made a written confession.

At the time of his arrest, police did not tell him that he could request assistance from the Mexican consulate - in violation of the 1963 Vienna Convention.

In 2003, Mexico filed a lawsuit at the ICJ against the US, on behalf of Medellin and 50 other Mexican nationals on death row in the US who had also not received consular support.

The court ruled in Mexico's favour, and ordered that their cases be reviewed.

It said Texas must hold a hearing to determine whether Medellin had had a fair trial.

Texas acknowledged that Medellin was not told he could ask for help from Mexican diplomats, but argued that he forfeited the right because he never raised the issue at trial or sentencing.

The state also argued that it would not have made any difference to the outcome of the case.

'Heinous murder'

Roe Wilson, an assistant district attorney in Harris County, Texas, welcomed the Supreme Court's decision.

"This case has been in the court system a long time based on various issues," she told the Associated Press.

"It was a heinous murder of two young girls... It's certainly time the case be resolved and the sentence be carried out. "

Ms Wilson told AP her office would be seeking an execution date once the Supreme Court has resolved a separate case challenging lethal injections.

The US has since withdrawn from the part of the Vienna Convention that gives the ICJ the final say if foreign citizens say they were illegally denied access to diplomatic representation when arrested abroad.