Some of those trapped waved frantically from the building’s windows and roof while others tried to jump to safety. Firefighters perched on cranes smashed windows in an attempt to reach those inside, witnesses said.
Hundreds of people gathered to watch in the street below, Presstv Reported.
One man who tried to escape by descending from a rope fell, a Reuters witness said.
Rescue workers warned the death toll could rise sharply as fire fighters recovered charred bodies from the complex where an unknown number of office workers were engulfed by intense smoke and flames.
The building is in the upscale, built-up Banani area of the city and the cause of the fire was not immediately clear.
Dhaka police chief Asaduzzaman Mia told reporters at least 73 people were injured and being treated in hospitals across Dhaka.
The blaze comes a month after a massive inferno killed 71 people in an old neighborhood of the city. Critics at the time blamed poor enforcement of safety regulations in one of the world's most densely packed cities.
Helicopters joined 22 firefighting units that worked with the army, navy, air force and police to battle Thursday's blaze as smoke billowed into the sky.
"The fire is almost under control,” said Mizanur Rahman, a senior fire service official at the scene.
Several of the roughly 140 employees of the private firm Quasem Group that had multiple offices in the building escaped across a roof to an adjacent building, said Shamim Reza Khan, an assistant general manager at the firm.
Nanda, a finance manager at the IT firm AAMRA which has offices on four different floors in the building, said he escaped with 20 colleagues.