The blaze broke out in a 28-storey building in the Jing'an district that was being renovated and spread quickly to the upper floors, Xinhua said.
More than 50 people injured by the fire were taken to a nearby hospital, and firefighters were searching the building for bodies and survivors, Xinhua quoted the municipal authorities as saying.
At the height of the blaze, helicopters tried to rescue people trapped on the roof of the building, many of whose residents were teachers at nearby schools and pensioners.
Public Security Minister Meng Jianzhu was on his way to Shanghai to direct the rescue work.
The cause of the fire was unknown, but a witness said he saw construction materials burning before the fire climbed up the scaffolding and quickly spread, Xinhua reported.
(Editing by Tim Pearce in London)
Copyright © 2010 Reuters