At least nine terrorists shouting "Allahu Akbar" barged into the Holey Artisan Bakery, frequented by diplomats and expatriates, and opened indiscriminate fire at around 9:20 PM (local time).
Several foreigners, including Italians and Japanese, were feared to have been taken hostage along with locals inside the restaurant, said police.
"We are trying to negotiate with the gunmen holed up inside the restaurant," Rapid Action Battalion (RAB) chief Benazir Ahmed told newsmen. "Our first priority is to save the lives of the people trapped inside."
At least 30 people and policemen were injured in the firefight.
Also Read
The attackers hurled bombs from inside the restaurant and were firing intermittently. When the police tried to get iside the building the gunmen triggered a blast to stop tthem. Several gunshots and explosions were heard near the restaurant.
MEA sources in New Delhi said they were monitoring the situation in Dhaka and trying to ascertain the details.
US President Barack Obama has been briefed by his top counter-terrorism official on the attack in Bangladesh, a White House official said, adding that they are monitoring the situation there.
Local media reports said the number of gunmen could be as high as 20 but there was no official word on it.
A large number of policemen and personnel from the RAB have cordoned off the area. Security personnel were seen warding off people crowding the cordon.
A kitchen staff of the restaurant, who managed to escape, said several armed men entered the restaurant around 8:45 PM and took the chief chef hostage, according to media reports.
It was not clear who the attackers were, but reports said that authorities suspect Islamists to be behind the attack.
The Muslim-majority Bangladesh has been fighting a wave of deadly attacks on religious minorities and secular bloggers by suspected Islamist militants.
Earlier today, a Hindu priest and a Buddhist leader were brutally hacked to death by machete-wielding Islamic State militants while another Hindu man survived a bid on his life.
On June 7, a 65-year-old Hindu priest was killed by three bike-borne assailants in western Bangladesh.
The ISIS and al-Qaeda in Indian Sub-Continent have claimed responsibility for most of the attacks even though the government has denied their presence in the country.