President Barack Obama is attempting to block the execution in Texas on Thursday of a Mexican man because it would breach an international convention and do "irreparable harm" to US interests.

The White House has asked the US supreme court to put the execution of Humberto Leal Garcia on hold while Congress passes a law that would prevent the convicted rapist and murderer from being put to death along with dozens of other foreign nationals who were denied proper access to diplomatic representation before trials for capital crimes.

The administration moved after the governor of Texas, Rick Perry, brushed aside appeals from diplomats, top judges, senior military officers, the United Nations and former president George W Bush to stay Leal's execution because it could jeopardise American citizens arrested abroad as well as US diplomatic interests.

Leal, 38, was convicted in 1994 of the rape and murder of a 16-year-old girl in San Antonio. Few question that he was responsible for the killing but the Texas authorities failed to tell Leal, who was born in Mexico and has lived in the US since the age of two, that under the Vienna convention he was entitled to contact the Mexican consulate when he was arrested.

Leal's lawyers argue that the lack of consular access played a role in the death penalty being applied because the Mexican national incriminated himself in statements made during "non-custodial interviews" with the police on the day of the murder. Had Leal had access to the Mexican consulate it would have been likely to have arranged a lawyer who would have advised the accused man to limit his statements to the police. As it was, the Mexican authorities were never informed of his arrest.

In a 30-page brief to the supreme court, the administration said that the carrying out of the execution "would place the United States in irreparable breach of its international law obligation" under the convention.

The White House said it was in the US's interests to meet its treaty obligations.

"These interests include protecting Americans abroad, fostering co-operation with foreign nations, and demonstrating respect for the international rule of law," it said.

Carrying out Leal's execution would cause "irreparable harm" to US interests abroad, the administration added.

"That breach would have serious repercussions for United States foreign relations, law-enforcement and other co-operation with Mexico, and the ability of American citizens travelling abroad to have the benefits of consular assistance in the event of detention," it said.

The legal situation has been complicated by earlier court rulings.

In 2004, the international court of justice (ICJ) ruled that the US authorities had failed to meet its legal obligations to 51 Mexicans awaiting execution in American prisons when they were not informed of their right to contact their consulates.

The then president, George W Bush, a former Texas governor who backs the death penalty, said the US would adhere to the ICJ ruling which, in effect, meant the death sentences would be reviewed or commuted. But in 2008 the supreme court ruled that while the US government was obliged to comply with the ICJ ruling it did not have the power to force individual American states to do so. Only Congress could require adherence by passing a law.

The Obama administration has told the supreme court that a bill has recently been introduced in to the Senate to do just that but it is unlikely to win the approval of both houses of Congress before next year. The White House wants Leal's execution put on hold until the law is passed but two courts have already ruled that pending legislation has no effect on the legal process.

The UN high commissioner for human rights, Navi Pillay, has appealed to Perry to commute Leal's sentence to life imprisonment.

Christof Heyns, the UN special rapporteur on extrajudicial, summary or arbitrary executions said that if Leal was put to death it would be "tantamount to an arbitrary deprivation of life".

Perry's office has said Texas laws had been abided by and that Leal would be executed for "the most heinous of crimes".