A group of up to nine attackers took hostages inside a restaurant frequented by both locals and foreigners in a diplomatic zone in Bangladesh's capital, local media reported.

Bangladesh TV stations reported that the attackers entered the Holey Artisan Bakery in Dhaka's Gulshan area around 9.20pm on Friday and were holding customers and staff hostage.

The identities of the attackers were not immediately known.

A huge contingent of security guards cordoned off the area and the restaurant as they traded gunfire with the attackers who set off explosions.

Jamuna Television reported, quoting a kitchen staff worker at the restaurant who escaped the attack, that the gunmen chanted "Allahu Akbar" (God Is Great) as they launched the attack.