Srivijayan was arrested in 2012 after 22.24 grams (0.8 ounces) of heroin was found in the car.

SINGAPORE (AFP) - Singapore on Friday executed a Malaysian drug trafficker despite a plea for clemency from the United Nations and concerns expressed by rights groups over alleged flaws in his trial.

Prabagaran Srivijayan was arrested in 2012 after 22.24 grams (0.8 ounces) of heroin was found in the car he was driving when it was stopped at a checkpoint going to Singapore.

He was sentenced to death two years later after being convicted of drug-trafficking. Trafficking certain volumes of illegal drugs into Singapore carries a mandatory death penalty unless certain conditions are met for the sentence to be commuted.

The 29-year-old was executed in prison on Friday, the city-state’s Central Narcotics Bureau said in a statement. Executions in Singapore are carried out by hanging.

The bureau said the amount of drugs he was caught with "is sufficient to feed the addiction of about 265 abusers for a week".

He had maintained his innocence and had launched appeals in both Singapore and his home country, including a bid in Malaysia’s Court of Appeal to get the neighbouring city-state referred to the Hague-based International Court of Justice.

His appeals in Singapore, including a last-ditch court challenge Thursday and an appeal to the president, were all rejected.

The execution was criticised by rights groups who had earlier this week urged Singapore to halt it while the Malaysian appeal was pending.

"(Srivijayan) was executed despite a pending appeal to have his case taken to the International Court of Justice, which would look into allegations that he was not given a fair trial," the UN human rights body said in a statement.

James Gomez, Amnesty International’s director for South East Asia and the Pacific, said: "That this cruel punishment has been administered after a trial filled with flaws makes this flouting of international law all the more disturbing."

But the narcotics bureau said following the execution that Srivijayan was "accorded full due process under the law, and he was represented by legal counsel throughout the process".

Singapore has consistently maintained that the death penalty is an effective deterrent to crime and has rejected calls to abolish capital punishment.

Malaysia also uses capital punishment, executing murderers and drug traffickers by hanging. The system, like that in Singapore, dates back to British colonial rule.