(CNN) -- When he was arrested in Turkey in 1970, Billy Hayes was given a choice of whom to call. For a scared young man facing serious charges, it was an easy decision: The U.S. consulate in Istanbul.
"It was an immense emotional relief, knowing I had someone to advise and help me at that early uncertain stage," he told CNN. "I wanted an American to talk with, not some foreign lawyer."
Hayes' story became the basis for his book and subsequent movie "Midnight Express," about surviving harsh conditions in a Turkish prison after being given a life sentence for drug smuggling charges.
He eventually escaped custody and now is speaking out in an international legal fight over a Mexican man on death row in Texas, scheduled to die Thursday. It is a high-stakes dispute over federal authority, local sovereignty and foreign treaties -- reaching far beyond the gruesome facts of a single murder.
The case of Humberto Leal Garcia Jr. is pending at the U.S. Supreme Court, which will decide whether to issue a stay of execution and whether to decide the broader legal question of what rights death row inmates from foreign nations deserve.
The Monterrey, Mexico, native's supporters say his fate could impact those Americans traveling abroad who, like Hayes, run into legal trouble.
The 38-year-old Leal was convicted of raping Adria Sauceda, a 16-year-old girl in San Antonio, then fatally strangling and bludgeoning her with a 35-pound piece of asphalt in 1994.
What makes his conviction unusual is that after his arrest he was not informed about access to the Mexican consulate he should have had under a binding international treaty. His appellate lawyers argue such access could at the very least have kept Leal off death row.
"I think in most of these cases it was not a deliberate thing. Local police lack training on (the Vienna Convention)," Sandra Babcock, Leal's defense lawyer of three years, told CNN in a phone interview.
Babcock argues Mexican officials would have ensured Leal had the most competent trial defense possible, if they had been able to speak with him right after his felony arrest.
Leal's backers say he has learning disabilities, brain damage and suffered from sexual abuse at the hands of his parish priest. They claim he did not learn of his consular access rights until two years after his capital conviction, and not from any official, but from a fellow prisoner.
From 2010 to 2011, Leal was eventually visited by a member of the Mexican consulate more than 10 times, Judy Garces, press relations spokeswoman with the Mexican consulate in San Antonio, told CNN.
The state argued that Leal never revealed his Mexican citizenship at arrest, and his defense team never raised the consular access issue at trial.
Prosecutors also say the evidence against him was indisputable. The victim was tortured, and a bite mark on her body was matched to Leal. A bloody shirt belonging to Sauceda was discovered at the suspect's home.
The two had attended a party separately earlier that evening. The girl's nude body was found on a dirt road.
Leal is one of 40 Mexican citizens in a similar situation awaiting lethal injection in U.S. prisons. But it is not the first time the U.S. Supreme Court has dealt with the issue.
The justices three years ago concluded Texas could execute another Mexican man sentenced to death for murder. Jose Medellin was given a lethal injection by the state a few months later.
The issue then and now is whether the state has to give in to a demand by the president that the prisoner be allowed new hearings and sentencing. In the 2008 case, President George W. Bush made that demand reluctantly after an international court concluded Medellin was improperly denied access to his consulate before his original prosecution, a violation of a treaty signed by the United States decades ago.
John Bellinger, then legal adviser to Bush and currently a lawyer in Washington, said the move by Bush was an extraordinarily difficult but necessary step to take.
"It is important for us to comply with our international law obligations, not because of some airy principles of international law or because of the reputation for the U.S. or world federalism," Bellinger said.
The U.S. Supreme Court agreed with the state at the time, saying the president had no unilateral authority to force the state to comply with international treaties, absent some specific congressional legislation.
To do so, said Chief Justice John Roberts, would violate state sovereignty. He said the International Court of Justice's ruling "is not domestic law."
Texas state courts have cited the ruling in denying Leal's appeals over the years, concluding they do not have to abide by federal executive and international authority in these kinds of cases.
Only Oklahoma has commuted a capital inmate's sentence to life in prison in response to the international judgment.
The International Court of Justice ruled in 2004 the United States had violated the rights of those prisoners, in part because officials and prosecutors failed to notify their home countries, from which the men could have received legal and other assistance. Those judges ordered the United States to provide "review and reconsideration" of the sentences and convictions of the Mexican prisoners.
The court is based in The Hague, Netherlands, and resolves disputes between nations over treaty obligations. The United States is one of the signatories to the 1963 Vienna Convention, laying out rights of people detained in other nations. The case turned on what role each branch of government plays to give force to international treaty obligations.
The Mexican government filed an appeal with the high court in Washington this past week, asking the justices to block Leal's execution, citing Bush's executive action.
And the Obama administration Friday also asked Texas to delay the execution.
"This case implicates United States foreign-policy interests of the highest order," including protecting U.S. citizens abroad and promoting good relations with other countries, new Solicitor General Donald Verrilli Jr. said.
It is rare for the federal government to intervene in cases dealing with state executions.
Congress has now stepped in. Sen. Patrick Leahy, D-Vermont, chairman of the Judiciary Committee, in June introduced a bill to formally grant federal courts the power to review these kinds of appeals.
As it stands now, there is nothing in force that imposes a consequence for failure to satisfy the Vienna Convention. The crafted legislation is seen as a narrow solution to only the most critical cases, such as Leal's. Currently, people can file a motion with the federal court, but courts have ruled in line with habeas relief law that if consular access was not raised at the preliminary trail then the defendant is barred from bringing it up.
Leal's lawyers had asked a federal judge in San Antonio to delay the execution until Congress can pass the legislation. But U.S. District Court Judge Orlando Garcia -- no relation to the inmate -- said no.
He ruled last week the consulate claim was "utterly lacking in arguable merit."
The prisoner also has a pending clemency request with Republican Gov. Rick Perry. The state has executed six men this year, and has scheduled at least six more in the next two months.
As governor, Perry had earlier led the legal fight in the Medellin case. His office has indicated it would not comment on the Leal case until the Texas Board of Pardons and Paroles has ruled on a pending clemency request.
Hayes has written the governor, asking for a reprieve for Leal. Speaking from Los Angeles, where he is a writer, director and activist, the 64-year-old Hayes says the state is being "self-centered" and short-sighted.
"I wonder what they would think if one of their citizens travels overseas and gets arrested, like I was and Mr. Leal was. Different culture, different laws, different language. Who can you trust? Maybe only your embassy or consulate."
Ignoring Leal's rights would imperil the rights of Americans traveling or living abroad, Hayes said. "If our own country is unwilling to abide by the convention, that would send a message to other countries about our respect for the law, that they can ignore their obligations too."
Leal's pending execution date comes the same week as the 35th anniversary of the resumption of the death penalty by the Supreme Court. Thirty-four states still have the procedure on the books, but only about half conduct executions on a regular basis.
The legal questions are no longer about whether state-sanctioned capital punishment is constitutional, but when it can be used.
Exceptions have been carved, for the mentally retarded, for underage killers and for those receiving inadequate legal representation.
Leal's case sits on the rim of circumstances that most other condemned prisoners will not face. But how the justices address this not-so-unique issue in coming days or months -- if they choose to do so -- could eventually reach beyond the current death penalty debate. But it may turn out to be too late for Texas inmate number 999162.
"The hardest thing for people in this situation is the agony of hope," Babcock said. "You want to hope, but it's difficult not knowing what will happen."
The Supreme Court appeal is Leal v. Texas (11-5001).