International Covenant on Civil and Political Rights

Article 6

... 

2. In countries which have not abolished the death penalty, sentence of death may be imposed only for the most serious crimes in accordance with the law in force at the time of the commission of the crime and not contrary to the provisions of the present Covenant and to the Convention on the Prevention and Punishment of the Crime of Genocide. This penalty can only be carried out pursuant to a final judgement rendered by a competent court.

...

Carta de los Derechos Fundamentales de la Unión Europea