Dhaka: Attackers in Bangladesh wielding machetes killed a liberal blogger, police said on Thursday, the latest in series of murders of secular activists by suspected Islamist militants.

Postgraduate law student Nazimuddin Samad, 28, was attacked as he was returning from a class at his university in the capital, Dhaka, late on Wednesday, police said.

Last year, suspected militants killed five secular writers and a publisher, including a Bangladeshi-American activist. A banned Islamist militant group, Ansarullah Bangla Team, claimed responsibility for some of the attacks.

Police officer Tapan Chandra Shaha said three or four men attacked Samad with machetes and then shot him after he fell to the ground.

People heard the attackers shouting "Allahu akbar" (God is Greatest) as they fled, he said.

Imran H Sarker, convener of the BOAN online activist group said Samad was an outspoken critic of injustice and militancy.

"We found him always a loud voice against all injustice and also a great supporter of secularism," Sarker told Reuters.

Bangladesh has seen a wave of militant violence over the past year or so, including a series of bomb attacks on mosques and Hindu temples.

Some recent attacks have been claimed by Islamic State, including the killing of Hindu priest, a Japanese citizen, an Italian aid worker and a policeman.

The government denies that Islamic State has a presence in the Muslim-majority country of 160 million people.