Bangladesh executed an Islamist militant leader and two of his 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. Their attack on a Muslim shrine killed three people and wounded the then-British high commissioner.

Mufti Abdul Hannan, the head of the banned Harkat-ul Jihad Islami group, Sharif Shahedul and Delwar Hossain 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 (1600 GMT) in two prisons," Mizanur Rahman, senior superintendent of Kashimpur Central Jail, told Reuters.

Hannan, 60, and Shahedul were executed in the Kashimpur jail, on the outskirts of the capital. Hossain was hanged in Sylhet central jail.

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

Hannan's wife Zakia Parvin said he was innocent.

"He has no connection with militancy," she told reporters earlier on Wednesday after meeting her husband for the last time.

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

Hannan, who was arrested late in 2005, was believed to have fought in Afghan war against Soviet Union before joining the militant group.

Harkat-ul Jihad Islami was blamed for several other attacks, including a bomb blast later in 2004 at a rally by Prime Minister Sheikh Hasina, who was then the leader of the opposition. Hasina narrowly survived 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.

Security has been strengthen across the country before the traditional Bengali New Year celebrations on April 15.

Police and army commandos have killed more than 60 suspected militants and arrested hundreds since a deadly attack on a Dhaka cafe in July last year. Twenty-two people were killed, most of them foreigners.

Al Qaeda and Islamic State have also claimed responsibility for killings of foreigners, liberals and members of religious minorities in Bangladesh over the past few years.

The government has denied the presence of such groups, blaming domestic militants instead.