Image copyright AP Image caption Xulhaz Mannan's funeral was held on Tuesday

A Bangladeshi militant group affiliated to al-Qaeda, Ansar al-Islam, says it was behind the killing of a top gay rights activist and his friend.

Xulhaz Mannan, editor of a LGBT magazine, and actor Tanay Mojumdar, were hacked to death on Monday.

Prime Minister Sheikh Hasina has blamed opposition parties for the killings, claims denied by the opposition.

It comes after a university professor was hacked to death by suspected Islamist militants on Saturday.

At least 20 people - including professors, secular writers and bloggers, foreigners and members of religious minorities - have been killed in attacks blamed on Islamist militants since 2013.

Who is behind the Bangladesh killings?

Lurching from secularism to sectarian terror?

Ansar al-Islam said on Twitter that it had killed Mr Mannan and Mr Mojumdar because they were working "to promote homosexuality... with the held of their masters, the US crusaders and their Indian allies".

The claim could not be independently verified.

Mr Mannan edited Roopbaan, a magazine and activist group for the Lesbian, Gay, Bisexual and Transgender (LGBT) community that had received some support from foreign embassies.

Image copyright AP Image caption Locals gathered outside the building where Mr Mannan and Mr Mojumdar were killed

The US ambassador to Bangladesh said he was "devastated by the brutal murder of Xulhaz Mannan and another young Bangladeshi". Mr Mannan had also worked at the US embassy.

On Monday night, Prime Minister Sheikh Hasina said the opposition Bangladesh Nationalist Party (BNP) and its ally, the Jamaat-e-Islami group, were "involved in these killings and committing these murders" as a way to destabilise Bangladesh.

The opposition denied her claims, and local media have criticised the government, saying it is responsible for protecting minorities.

Blogger deaths

Earlier this month, a Bangladeshi law student who had expressed secular views online died when he was hacked with machetes and then shot in Dhaka.

Last year, four prominent secular bloggers were also killed with machetes.

The four bloggers had all appeared on a list of 84 "atheist bloggers" drawn up by Islamist groups in 2013 and widely circulated.

Two foreigners - an Italian aid worker and a Japanese farmer - have also been killed, with both attacks claimed by so-called Islamic State, although the government denies the presence of IS on its soil.

Who is being targeted?

The grim list of those who have fallen victim to attacks by Islamist militants in Bangladesh is growing ever diverse.

Secular bloggers, academics, gay rights activists, and members of religious minorities including Shia, Sufi and Ahmadi Muslims, Christians and Hindus have all been killed, many of them hacked to death.

That a university professor whose family said believed in God could also be murdered suggests the list of those at risk has widened further.

Who exactly is behind the attacks remains murky. Bangladesh has myriad extremist groups and there have been few convictions over the attacks.

Bangladesh has disputed claims by so-called Islamic State or al-Qaeda-linked groups for the attacks, instead often blaming opposition parties or local Islamist groups.

But until the killings stop the government itself will face accusations of not doing enough to protect minorities in the Sunni-dominated nation.