Bangladesh executed an Islamist militant leader and two aides on Wednesday for a grenade attack on the British ambassador in 2004, a senior prison official said, days after the president turned down their clemency pleas.

The Supreme Court last month upheld death sentences for the three militants, who included Mufti Abdul Hannan, the head of the Harkat-ul Jihad Islami group, for the attack on a Muslim shrine that killed three people and wounded the then British high commissioner.

The trio were convicted and sentenced to death in 2008 for the attack, which took place on May 21, 2004, after Friday prayers in the northeastern district of Sylhet.

The Bangladesh-born British envoy, Anwar Choudhury, was wounded in the leg. About 50 others were also injured.

“They were hanged at 10 pm in two prisons," Mizanur Rahman, senior superintendent of Kashimpur Central Jail, told Reuters.

Hannan, 60, and another convict, Sharif Shahedul, were executed in the Kashimpur jail, on the outskirts of the capital, while the other militant, Delwar Hossain, was hanged in Sylhet central jail.

The execution took place amid a spate of militant attacks in the Muslim-majority nation of 160 million people, with at least three attacks targeting police late last month claimed by the Islamic state.

Last month, suspected militants attempted to free him by hurling bombs on a police van carrying him.

Harkat-ul Jihad Islami was blamed for several other attacks, including a bomb blast later in 2004 at a rally by then opposition leader Sheikh Hasina, who later became prime minister. Ms. Hasina narrowly survived the attack but 23 people were killed and more than 150 were wounded.

Hannan was also sentenced to death for a bomb attack on a Bengali New Year's celebration in 2001 that killed 10 people and wounded scores.